[luatex] Calling texlua from texlua, with a space in the tex binary path
Reinhard Kotucha
reinhard.kotucha at web.de
Sun Nov 2 00:06:48 CET 2014
On 2014-11-01 at 12:29:29 +0100, Siep Kroonenberg wrote:
> I am investigating this in connection with my epspdf texlua script,
> which calls luatex at some point. A user who had installed miktex
> under Program Files ran into a problem. When I ran my test suite --
> another texlua script -- I ran into more problems.
>
> So I wrote a texlua test script which calls another texlua script in
> the same directory and ran it with portable miktex, with TL/linux
> and with TL/w32. Note that TL is portable out of the box in all
> respects that matter here. None has its binaries on the searchpath.
Hi Siep,
I must admit that I don't know what you mean with "None has its
binaries on the searchpath.". LuaTeX has to be in PATH, otherwise the
shebang line
#!/usr/bin/env texlua
wouldn't work.
When I apply the patch below to your script I see that the line
os.setenv('PATH', os.selfdir..pathsep..os.getenv('PATH'))
adds something to PATH which exists there already.
PATH[1]: /home/reinhard/bin/prepend
PATH[2]: /opt/gs/9.15/bin
PATH[3]: /usr/local/texlive/2014/bin/x86_64-linux
PATH[4]: /usr/local/bin
PATH[5]: /usr/bin
PATH[6]: /bin
PATH[7]: /opt/bin
PATH[8]: /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4
PATH[9]: /usr/games/bin
PATH[10]: /home/reinhard/bin
PATH[11]: /usr/local/speedata-publisher/bin
prepending "/usr/local/texlive/2014/bin/x86_64-linux" (os.selfdir) to PATH
PATH[1]: /usr/local/texlive/2014/bin/x86_64-linux
PATH[2]: /home/reinhard/bin/prepend
PATH[3]: /opt/gs/9.15/bin
PATH[4]: /usr/local/texlive/2014/bin/x86_64-linux
PATH[5]: /usr/local/bin
PATH[6]: /usr/bin
PATH[7]: /bin
PATH[8]: /opt/bin
PATH[9]: /usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4
PATH[10]: /usr/games/bin
PATH[11]: /home/reinhard/bin
PATH[12]: /usr/local/speedata-publisher/bin
There is no reason to have /usr/local/texlive/2014/bin/x86_64-linux
twice in PATH. If you apply my patch, what do you get on Windows?
Regards,
Reinhard
--- tlu_caller.tlu-siepo 2014-11-01 11:57:53.000000000 +0100
+++ tlu_caller.tlu 2014-11-01 23:29:20.000000000 +0100
@@ -16,6 +16,16 @@
io.read()
end
+function show_path(pathsep)
+ local PATH=os.getenv('PATH')
+ local path = string.explode(PATH, pathsep)
+ print() -- insert \n.
+ for i,v in ipairs(path) do
+ print ('PATH['..i..']: ', v)
+ end
+ print()
+end
+
dirsep = (os.type=='unix' and '/') or '\\'
pathsep = (os.type=='unix' and ':') or ';'
@@ -45,7 +55,10 @@
os.spawn({otherprog, '--version'})
--]]
+show_path(pathsep)
+print ('prepending "'..os.selfdir..'" (os.selfdir) to PATH')
os.setenv('PATH', os.selfdir..pathsep..os.getenv('PATH'))
+show_path(pathsep)
next_test()
@@ -64,3 +77,10 @@
os.spawn({luabare, '--version'})
os.spawn({otherbare, '--version'})
--]]
+
+-- Local Variables:
+-- lua-indent-level: 2
+-- tab-width: 2
+-- indent-tabs-mode: nil
+-- End:
+-- vim:set tabstop=2 expandtab: #
More information about the luatex
mailing list