delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/12/01/13:24:44

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:message-id:date:mime-version
:content-type:content-transfer-encoding; q=dns; s=default; b=Bjw
0ZLWgtbu8k7UBxsujqlePQL9AqB3uEy2injVMYzOepqjgDdlqw/wMK4zZU+vD7eq
9D9HyKdjBItRJzLtNFu0tPlQpLeEANtD1p4o1SpGO3jlA5THQTWZx/gkBdAMyu8t
qr8HvIe4MJ4hxS0qpbzYSStTMxuRf5YzRDfh3l2k=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:message-id:date:mime-version
:content-type:content-transfer-encoding; s=default; bh=cqoKfkvPR
jnayw+ATe4vC3I4dhY=; b=Ez4/vN8WhfzdPJikMuGHgCmjNyWoMzJWZYICMPdu/
eVmY7Q1M8rS2eCWaYNtTBqaJfcUHJnKb2AJcm5/lHK00HOJ88a0gIb4GEQ9RUQ4U
H10TNreRI5PCQFYaToYwJMYmVPuwx84QsGmf0FpobMGOYfvaWCPSOkGTu/w5h4+F
kc=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=
X-HELO: mail307.opentransfer.com
To: cygwin AT cygwin DOT com
From: Enrqiue Perez-Terron <enrique AT perezterron DOT net>
Subject: [patch] /etc/postinstall/GeoIP-database.sh terminates with exit code 1
Message-ID: <3f09aa14-e86d-b6c2-be4f-77011e7ac6ff@perezterron.net>
Date: Thu, 1 Dec 2016 19:24:23 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0
MIME-Version: 1.0

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019