public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin-apps@cygwin.com
Subject: [Nitpicks] Non-standard Cygwin-only hashbangs in base-files, biber, hg, xlsx2csv, xmlto scripts
Date: Thu, 27 Jul 2017 05:42:00 -0000	[thread overview]
Message-ID: <1d917c29-7291-8514-58ab-34bc1b0cd2aa@SystematicSw.ab.ca> (raw)
In-Reply-To: <87r2xc73of.fsf@Rainer.invalid>

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

      reply	other threads:[~2017-07-27  5:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19 17:11 Perpetual postinstall scripts Achim Gratz
2017-07-27  5:42 ` Brian Inglis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d917c29-7291-8514-58ab-34bc1b0cd2aa@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).