From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24391 invoked by alias); 27 Jul 2017 05:42:55 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 15030 invoked by uid 89); 27 Jul 2017 05:42:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy= X-HELO: smtp-out-so.shaw.ca Received: from smtp-out-so.shaw.ca (HELO smtp-out-so.shaw.ca) (64.59.136.139) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Jul 2017 05:42:41 +0000 Received: from [192.168.1.100] ([24.64.240.204]) by shaw.ca with SMTP id abZCdJd5RMaqMabZDd8M7k; Wed, 26 Jul 2017 23:42:35 -0600 X-Authority-Analysis: v=2.2 cv=Qc8WhoTv c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=wn2tWnfOKRrLvmu7J_sA:9 a=QEXdDO2ut3YA:10 Reply-To: Brian.Inglis@SystematicSw.ab.ca Subject: [Nitpicks] Non-standard Cygwin-only hashbangs in base-files, biber, hg, xlsx2csv, xmlto scripts To: cygwin-apps@cygwin.com References: <87r2xc73of.fsf@Rainer.invalid> From: Brian Inglis Message-ID: <1d917c29-7291-8514-58ab-34bc1b0cd2aa@SystematicSw.ab.ca> Date: Thu, 27 Jul 2017 05:42:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <87r2xc73of.fsf@Rainer.invalid> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfLf3Gk7lYDzQcG3umBPKNL3MunuBLab/Ju/gZtMZpEmzctCUW9/NcYv121nDw7g0yeYcdrh4avfHPSL9bturOxQf8l4rlhcDeeGbuGng0h+7u+TGnp61 kqv7iq7tOCHjQ5+OiApnq67IQDHz+iUR7Hc42TVCFJRATgPO6agEV9LUWzrCspDrnypU99GkETlwrg== X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00066.txt.bz2 Hi folks, Running file(1) detects non-standard Cygwin-only hashbangs in base-files, biber, hg, xlsx2csv, xmlto scripts. If standard paths were used, these would be detected and named in file(1) output as POSIX shell, Perl, Python, etc. scripts. The use of /usr/bin/sh instead of standard /bin/sh, /bin/python instead of /usr/bin/python, and /usr/bin/perl.exe instead of /usr/bin/perl could be a problem if these scripts were used in cross-build environments, and the exec function did not fall back to a path search for the interpreter. It would be nice if these could be cleaned up in the next releases, unless there are reasons for those non-standard paths to avoid use on non-Cygwin platforms. Also xmlto works only if the default /bin/sh is bash as it uses declare, echo -e, and test == -- either the hashbang or the bashisms should be fixed: see bottom for checkbashisms output. $ file /etc/preremove/base-files.sh /usr/bin/{biber,hg,xlsx2csv,xmlto} /etc/preremove/base-files.sh: a /usr/bin/sh script, ASCII text executable /usr/bin/biber: a /usr/bin/perl.exe script, UTF-8 Unicode text executable /usr/bin/hg: a /bin/python script, ASCII text executable /usr/bin/xlsx2csv: a /bin/python script, ASCII text executable /usr/bin/xmlto: a /usr/bin/sh script, ASCII text executable $ head -1 /etc/preremove/base-files.sh /usr/bin/{biber,hg,xlsx2csv,xmlto} ==> /etc/preremove/base-files.sh <== #!/usr/bin/sh ==> /usr/bin/biber <== #!/usr/bin/perl.exe ==> /usr/bin/hg <== #!/bin/python ==> /usr/bin/xlsx2csv <== #!/bin/python ==> /usr/bin/xmlto <== #!/usr/bin/sh $ checkbashisms /usr/bin/xmlto possible bashism in /usr/bin/xmlto line 134 (declare): declare -a XSL_MODS possible bashism in /usr/bin/xmlto line 138 (declare): declare -a CLEANFILES possible bashism in /usr/bin/xmlto line 583 (echo -e): [ "${VERBOSE}" -ge 1 ] && \ echo -e >&2 "${XSLTPROC_PATH} ${XSLTOPTS} ${SEARCHPATH_FORMATTED} \\\\\n -o \"${XSLT_PROCESSED}\" \\\\\n \"${STYLESHEET}\" \\\\\n \"${INPUT_FILE}\"" possible bashism in /usr/bin/xmlto line 590 (should be 'b = a'): if [ $? == 4 ] possible bashism in /usr/bin/xmlto line 595 (echo -e): echo -e >&2 "${XSLTPROC_PATH} ${XSLTOPTS} ${SEARCHPATH_FORMATTED}\\\\\n -o \"${XSLT_PROCESSED}\" \\\\\n \"${STYLESHEET}\" \\\\\n \"${INPUT_FILE}\"" -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada