-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TeX Live: mptopdf
is broken
#24343
Comments
There are some other Perl scripts in the TeX Live source repo that also have this weird https://www.tug.org/svn/texlive/trunk/Master/texmf-dist/scripts/context/perl/ They're not installed as part of the |
I haven't noticed this ticket; it should be OK now on both master and 17.03. These ugly pseudo-shebangs are now detected and wrapped by |
Fixes NixOS#24343. These parts of upstream texlive are really ugly. Also improve variable quoting in the code around. (cherry picked from commit 8dddd2b) The change seems safe enough.
Issue description
The
mptopdf
executable installed as part oftexlive.combined.scheme-basic
errors out no matterwhat arguments it's called with, with an error:
Steps to reproduce
nix-env -f '<nixpkgs>' -iA texlive.combined.scheme-basic
mptopdf
Notes
The problem seems to come from these lines at the very beginning of the
mptopdf.pl
Perl script thatthe TeX Live derivation wraps around:
It's using
exec
and$0
to do what a shebang does instead of... just using a shebang.The Perl call is expecting
$0
to point directly to themptopdf.pl
script, but the Nix wrapperscript is setting
$0
to whatever command it was called with; in this case, the raw string"mptopdf"
.Placing these lines in a separate executable file (let's say
mptopdf.sh
) and simulatingwhat the wrapper script does, reproduces the error message:
After replacing the instance of
perl
in the first exec call with an absolute store path,and
$0
with the store path tomptopdf.pl
, the command above then works and callsmptopdf
as intended.
The TeX Live distribution installed on my Ubuntu setup looks like it just replaced those first
two lines in
mptopdf.pl
with#! /usr/bin/perl -w
. So it seems like the easiest way would be eitherto patch
mptopdf.pl
to use a shebang line pointing directly to Perl, or to patch the wrapper scriptcreated around
mptopdf
to pass something else as$0
; that is, change this line in the wrapperscript:
to this:
so that the Perl script can find and call itself.
Technical details
17.03beta685.1dbb962 (Gorilla)
1.11.8
17.03beta685.1dbb962
The text was updated successfully, but these errors were encountered: