[tex-live] script for LuaTeX font database updating
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 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 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
Or for all foobar-sys scripts if needed.
> Tomek, what do you mean with "I can't alter argv for scripts"?
> Don't you have to simply pass argv 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 = perl.exe
argv = c:/tlroot/texmf-dist/scripts/epstopdf/epstopdf.pl
argv = ...
When perl.exe executes epstopdf.pl, it shifts all, so that $ARGV is
c:/tlroot/texmf-dist/scripts/epstopdf/epstopdf.pl. If you want to lie to the
script about its $ARGV, you have to lie to perl.exe about its argv, 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 of /usr/bin/perl is the name of the
symlink, which still allows Perl to find the real file, and gives the expected
$ARGV 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.
More information about the tex-live