[tex-live] Be careful setting TEXINPUTS when running with luatex and friends

Karl Berry karl at freefriends.org
Sun Aug 28 20:16:38 CEST 2011


Eliding the spurious $TEXINPUTS from the test definition ...

    voss at shania:~> kpsewhich lualibs.lua
    /usr/local/texlive/2011/texmf-dist/tex/luatex/lualibs/lualibs.lua
    voss at shania:~> export TEXINPUTS=.:
    voss at shania:~> kpsewhich lualibs.lua

Running with --debug=-1, it's clear enough why it fails.  The LUAINPUTS
definition is
LUAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXINPUTS

and default expansion happens earlier than variable expansion, so the
path ends up with a literal : --
LUAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;.:

And : is a path separator, so we end up just searching . again.

It's also clear enough what is intended, but kpathsea has no concept of
"while expanding $FOO, do default expansion of variable $BAR" -- because
it's never come up before.  This LUAINPUTS definition is the only place
in texmf.cnf where a separate variable $BAR is used in the definition
(not counting $OSFONTDIR, which isn't an issue).

Therefore, I think a sufficient workaround for us is to duplicate the
values for TEXINPUTS.*lua{la,}tex in LUAINPUTS, instead of using
$TEXINPUTS literally.  At least it works for me.  Granted it is ugly:

LUAINPUTS.lualatex = .;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{lualatex,latex,luatex,generic,}//
LUAINPUTS.dvilualatex = .;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{lualatex,latex,luatex,generic,}//
LUAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{luatex,plain,generic,}//

I'm committed a new texmf.cnf to TL svn with these settings, it should
be in tlcritical after tonight's build if anyone wants to test.

karl


More information about the tex-live mailing list