[tex-live] script for LuaTeX font database updating

Reinhard Kotucha reinhard.kotucha at web.de
Thu Feb 25 19:15:30 CET 2010

On 25 February 2010 T T wrote:

 > > I'm thinking now about making writing a wrapper for it look more like
 > > another TeXLive script, the thing is I'm not really aware of all the
 > > techniques TeX Live has to use in order to execute scripts on all
 > > platforms, and thus I don't really know how to build it... can someone
 > > explain me how to build such a script (restrictions on languages,
 > > modules to use, etc.)?
 > On Windows only Perl and Lua are available out of the box. Our tlperl
 > comes with a bunch of standard modules, Lua is rather bare-bones but
 > it has direct access to kpathsea library. In both cases language
 > primitives should be sufficient for simple parsing.

texlua also has many libraries compiled into the binary and thus it's
quite usable.

 > > Also, currently the script writes in the user's TEXMFVAR, it is a good
 > > idea to make a -sys version of the wrapper that would write in the
 > > system's TEXMFVAR, or is a --sys switch better?
 > 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.

There is at least an advantage, at least on Unix.  People who are
using command completion will notice immediately that there is a -sys

Formerly -sys programs were directly supported by the generic wrapper,
like this:

   if string.find(progname, '-sys$') then
     basename = (string.gsub(progname, '-sys$', ''))
     basename = progname

   if sys then
     os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
     os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
     os.setenv('TEX_SYS_PROG', 'true')

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.

Since the only difference between programs and the -sys variants is a
changed environment, I found the original behavior of the wrapper more

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?


Reinhard Kotucha			              Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.

More information about the tex-live mailing list