[tex-live] Inconistent shebangs in texmf-dist/scripts/*/*.pl

Johannes Hielscher jhielscher at posteo.de
Sat Nov 25 20:43:27 CET 2017


Hi,

on FreeBSD and some other platforms, the `perl` binary happens not to
lie in /usr/bin. On the upstream side, the standard trick to regain a
little platform-independence is to use `#!/usr/bin/env
perl` instead of `#!/usr/bin/perl`.

This is well-recognised in the major part of TL, cf.:
texmf-dist/scripts/glossaries/makeglossaries: # v1.3 (2008-03-08) :
#   * changed first line from /usr/bin/perl -w to /usr/bin/env perl
#     (Thanks to Karl Berry for suggesting this.)

and present in many of the scripts shipping with TL---but not for all:

grep -n perl $(gfind texmf-dist/scripts/ -type f -executable) | \
grep ':1:' | grep -c '\/usr\/bin\/env perl'
68

grep -n perl $(gfind texmf-dist/scripts/ -type f -executable) | \
grep ':1:' | grep -c '\/usr\/bin\/perl'
22

(in svn -r45900)


The shebangs could be quick-fixed in the sense of the following
one-liners:

sed -i $'1s/usr\/bin\/perl -w/usr\/bin\/env perl\\\nuse warnings;/'
 for
texmf-dist/scripts/splitindex/splitindex.pl
texmf-dist/scripts/urlbst/urlbst
texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl
texmf-dist/scripts/fragmaster/fragmaster.pl
texmf-dist/scripts/ctan-o-mat/ctan-o-mat.pl
texmf-dist/scripts/exceltex/exceltex

and

sed -i '1s/usr\/bin\/perl/usr\/bin\/env perl/'
 for
texmf-dist/scripts/mf2pt1/mf2pt1.pl
texmf-dist/scripts/latexpand/latexpand
texmf-dist/scripts/petri-nets/pn2pdf
texmf-dist/scripts/findhyph/findhyph
texmf-dist/scripts/ulqda/ulqda.pl
texmf-dist/scripts/mathspic/mathspic.pl
texmf-dist/scripts/ctanupload/ctanupload.pl
texmf-dist/scripts/svn-multi/svn-multi.pl
texmf-dist/scripts/mycv/mycv_split_contents.pl
texmf-dist/scripts/makedtx/makedtx.pl
texmf-dist/scripts/multibibliography/multibibliography.pl
texmf-dist/scripts/accfonts/vpl2vpl
texmf-dist/scripts/yplan/yplan
texmf-dist/scripts/accfonts/vpl2ovp
texmf-dist/scripts/xetex/perl/xdv2pdf_mergemarks
texmf-dist/scripts/accfonts/mkt1font

(with `sed` being GNU sed this time)

In the cases where TeXLive's SVN is the primary repository for the
scripts, this replacement would be straightforward; for
author-maintained scripts, however, this would imply some communication
work \-:

I wonder (well, actually, I don't…) why there are apparently so few
requests about those kinds of trivial fixes, which are cheap
constituents to platform consistency.


Best regards,
Johannes



More information about the tex-live mailing list