[tex-live] script for LuaTeX font database updating

Manuel Pégourié-Gonnard mpg at elzevir.fr
Thu Feb 25 19:43:10 CET 2010


Reinhard Kotucha a écrit :
>  > Single common script is better. For Unix acting on argv[0] is standard
>  > and allows the -sys version to be a symlink. For Windows I need --sys
>  > switch for our universal wrapper, because I can't alter argv[0] for
>  > scripts (well, for Lua script I could, but switch will be less hackish
>  > :).
> 
> Since there are already some -sys scripts we can't get rid of, I think
> it's worthwhile to consider whether it makes sense to follow this
> scheme, just that such programs behave similar.
> 
I think the new script should follow this scheme.

> But the current wrapper only supports updmap-sys.  The result is that
> fmtutil exists twice on the system and getnonfreefonts-sys doesn't
> work anymore on Windows.
> 
It's easy to add support for getnonfreefonts-sys.

> Since the only difference between programs and the -sys variants is a
> changed environment, I found the original behavior of the wrapper more
> reasonable. 
> 
Or for all foobar-sys scripts if needed.

> Tomek, what do you mean with "I can't alter argv[0] for scripts"?
> Don't you have to simply pass argv[0] from the .exe to the wrapper and
> process it there?
> 
The point is, when the interpreter is not lua, the argument to system looks like

executable = /path/to/perl.exe
argv[0] = perl.exe
argv[1] = c:/tlroot/texmf-dist/scripts/epstopdf/epstopdf.pl
argv[2] = ...

When perl.exe executes epstopdf.pl, it shifts all, so that $ARGV[0] is
c:/tlroot/texmf-dist/scripts/epstopdf/epstopdf.pl. If you want to lie to the
script about its $ARGV[0], you have to lie to perl.exe about its argv[1], which
is impossible (or it will fail to find the file). One would need an option like
"perl.exe --set-argv0=c:/blabla/bin/repstopdf otherarguments".

On Unix, all works fine because the argv[1] of /usr/bin/perl is the name of the
symlink, which still allows Perl to find the real file, and gives the expected
$ARGV[0] in the script.

This is the same for all other interpreters. As Tomek said, one could make an
exception for texlua scripts, since the interpreter is the wrapper written by
Tomek, hence we have total control over everything. But I don't think it would
be a good idea: uniformity is better.


Manuel.


More information about the tex-live mailing list