This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] /etc/postinstall/GeoIP-database.sh terminates with exit code 1


Hello,

The file /etc/postinstall/GeoIP-database.sh has an error; 
it needs an absolute path in the first existence test (line 4 below).

The correct contents of the file becomes:

$ cat -n /tmp/GeoIP-database.sh
     1  for f in /usr/share/GeoIP/*.dat; do
     2      case ${f##*/} in
     3      GeoLiteCountry.dat)
     4          [ -e /usr/share/GeoIP/GeoIP.dat ] || /bin/ln -s ${f##*/} /usr/share/GeoIP/GeoIP.dat
     5          ;;
     6      GeoLite*.dat)
     7          [ -e ${f/Lite/IP} ] || /bin/ln -s ${f##*/} ${f/Lite/IP}
     8          ;;
     9      esac
    10  done

The uncorrected mistake makes the script terminate with this message:
(From /var/log/setup.log.full)

2016/12/01 18:26:35 running: C:\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/GeoIP-database.sh"
/bin/ln: failed to create symbolic link '/usr/share/GeoIP/GeoIP.dat': File exists
2016/12/01 18:26:35 abnormal exit: exit code=1



Patch:

$ diff -u /etc/postinstall/GeoIP-database.sh /tmp/GeoIP-database.sh
--- /etc/postinstall/GeoIP-database.sh  2016-11-08 21:47:53.000000000 +0100
+++ /tmp/GeoIP-database.sh      2016-12-01 18:50:18.768493100 +0100
@@ -1,7 +1,7 @@
 for f in /usr/share/GeoIP/*.dat; do
     case ${f##*/} in
     GeoLiteCountry.dat)
-        [ -e GeoIP.dat ] || /bin/ln -s ${f##*/} /usr/share/GeoIP/GeoIP.dat
+        [ -e /usr/share/GeoIP/GeoIP.dat ] || /bin/ln -s ${f##*/} /usr/share/GeoIP/GeoIP.dat
         ;;
     GeoLite*.dat)
         [ -e ${f/Lite/IP} ] || /bin/ln -s ${f##*/} ${f/Lite/IP}


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]