Discussion:
Inconistent shebangs in texmf-dist/scripts/*/*.pl
(too old to reply)
Johannes Hielscher
2017-11-25 19:43:27 UTC
Permalink
Raw Message
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
Karl Berry
2017-11-25 20:59:47 UTC
Permalink
Raw Message
Thanks for the report.

texmf-dist/scripts/xetex/perl/xdv2pdf_mergemarks

I believe this is the only one that is maintained in TL (well, really in
xetex.sf.net, but close enough). I'll fix that and tell Jonathan.

As for the rest, feel free to contact the upstream authors. I do not
want to make the changes in TL only. Sorry.

actually, I don't

Right, me either :). --best, karl.
Jonathan Kew
2017-11-25 21:22:49 UTC
Permalink
Raw Message
Post by Karl Berry
Thanks for the report.
texmf-dist/scripts/xetex/perl/xdv2pdf_mergemarks
I believe this is the only one that is maintained in TL (well, really in
xetex.sf.net, but close enough). I'll fix that and tell Jonathan.
Actually, I believe this is obsolete, as xdv2pdf is no longer supported
(it's not even in the tree any more, is it?)

JK

Loading...