Hi, I just fixed some nasty bugs in texlua wrappers for ppower4 and pdfthumb which are under texmf-dist/scripts in TeX Live. There are no problems on Windows: When I type "ppower4 --help", I get PPower4 [-v|-n|-h|-V|--verbose=<n>|--nocompress|--help|--version] infile outfile On Unix, however, I get a warning message: warning: kpathsea: configuration file texmf.cnf not found in these directories: [...] Here is [...] with colons replaced my linebraeks: /usr/local/texlive/2009/texmf-dist/scripts/ppower4 /usr/local/texlive/2009/texmf-dist/scripts /usr/local/texlive/2009/texmf-dist /usr/local/texlive/2009/texmf-dist/scripts/ppower4/share/texmf-local/web2c /usr/local/texlive/2009/texmf-dist/scripts/share/texmf-local/web2c /usr/local/texlive/2009/texmf-dist/share/texmf-local/web2c /usr/local/texlive/2009/texmf-dist/scripts/ppower4/texmf-local/web2c /usr/local/texlive/2009/texmf-dist/scripts/texmf-local/web2c /usr/local/texlive/2009/texmf-dist/texmf-local/web2c /usr/local/texlive/2009/texmf-dist/scripts/ppower4/share/texmf/web2c /usr/local/texlive/2009/texmf-dist/scripts/share/texmf/web2c /usr/local/texlive/2009/texmf-dist/share/texmf/web2c /usr/local/texlive/2009/texmf-dist/scripts/ppower4/texmf/web2c /usr/local/texlive/2009/texmf-dist/scripts/texmf/web2c /usr/local/texlive/2009/texmf-dist/texmf/web2c ...and pp4p.jar is obviously not found, Java then prints its own usage message. It seems that texmf.cnf is searched in texmf-dist only, but how can this happen? Strange enough, everything works fine on Windows. I can strip down the texlua script: ------------------------------------------------------------------ #!/usr/bin/env texlua if os.type == 'windows' then kpse.set_program_name('ppower4.exe', 'ppower4') else kpse.set_program_name('ppower4') end jarfile=kpse.find_file('pp4p.jar', 'texmfscripts') print (jarfile) ------------------------------------------------------------------ On Windows it returns /path/to/pp4p.jar, on Unix it returns "nil". The command kpsewhich -format=texmfscripts pp4p.jar returns the correct path on both, Unix and Windows. Hence, I think it's a LuaTeX problem. I don't think that fixing this problem is urgent. It's definitely not worthwhile to delay a TeX Live release. Karl, I can provide a simple solution for the time being: Because what we have in TeX Live already works as expected on Windows, we only need a solution for Unix. I could simply copy the shell scripts we had in TeX Live 2005 to texmf-dist/scripts/ppower4 and adapt the symlinks accordingly. Then everything works on all platforms. What do you think? Regards, Reinhard -- ---------------------------------------------------------------------------- Reinhard Kotucha Phone: +49-511-3373112 Marschnerstr. 25 D-30167 Hannover mailto:reinhard.kotucha@web.de ---------------------------------------------------------------------------- Microsoft isn't the answer. Microsoft is the question, and the answer is NO. ----------------------------------------------------------------------------
Hi Reinhard, You can debug the kpathsea in texlua just like you would a standalone script by setting KPATHSEA_DEBUG=-1 in the environment before running the script, perhaps that will help. Reinhard Kotucha wrote:
I can strip down the texlua script: ------------------------------------------------------------------ #!/usr/bin/env texlua
if os.type == 'windows' then kpse.set_program_name('ppower4.exe', 'ppower4') else kpse.set_program_name('ppower4')
Also, have you tried kpse.set_program_name('ppower4', 'ppower4')
The command
kpsewhich -format=texmfscripts pp4p.jar
returns the correct path on both, Unix and Windows. Hence, I think it's a LuaTeX problem.
Or you could try to set the program name to 'kpsewhich' (that is what I usually do in standalone scripts). The wrapper luatex provides around kpathsea is really shallow, so I am just as surprised by this problem as you are. Best wishes, Taco
Hi Reinhard, Reinhard Kotucha a écrit :
kpse.set_program_name('ppower4')
The problem is that kpse resolves symlinks before computing SELFAUTO* (which is what you want in most cases). So SELFAUTOLOC ends up being texmf-dist/scripts/ppoxer4 which obviously gives the wrong result. A general approach to this is to use kpse.set_program_name(arg[-1], 'ppower4') which works on all platforms (I'm using it in texdoc and never got any complaint). As you probably know, arg[-1] is the name of the Lua interpreter used for the current script, which gives good results for computing SELFAUTO*. I guess that's the whole purpose of the two-arguments form of kpse.set_program_name. (Btw, at some point there was a bug in kpse so that the first argument was ignored on GNU platforms and SELFAUTO* set to "correct" values even if the argument was "wrong" on platform using the GNU libc. So this kind of problem was hidden on, eg Linux, when this bug was present. After the bug was fixed, I looked a bit for othe occurences in TeX Live, but apparently I missed some of them.) Manuel.
On 1 November 2009 Manuel Pégourié-Gonnard wrote:
Hi Reinhard,
Reinhard Kotucha a écrit :
kpse.set_program_name('ppower4')
The problem is that kpse resolves symlinks before computing SELFAUTO* (which is what you want in most cases). So SELFAUTOLOC ends up being texmf-dist/scripts/ppoxer4 which obviously gives the wrong result.
A general approach to this is to use
kpse.set_program_name(arg[-1], 'ppower4')
which works on all platforms (I'm using it in texdoc and never got any complaint). As you probably know, arg[-1] is the name of the Lua interpreter used for the current script, which gives good results for computing SELFAUTO*. I guess that's the whole purpose of the two-arguments form of kpse.set_program_name.
Hi Manuel, thank you very much for the explanation. Yes, it's a very good solution, maybe the best. I fixed it this way.
(Btw, at some point there was a bug in kpse so that the first argument was ignored on GNU platforms and SELFAUTO* set to "correct" values even if the argument was "wrong" on platform using the GNU libc. So this kind of problem was hidden on, eg Linux, when this bug was present. After the bug was fixed, I looked a bit for othe occurences in TeX Live, but apparently I missed some of them.)
When I checked the stuff in texmf/scripts, I obviously didn't remember that ppower4 was moved to texmf-dist/scripts. Maybe you overlooked it for the same reason. Regards, and thanks again, Reinhard -- ---------------------------------------------------------------------------- Reinhard Kotucha Phone: +49-511-3373112 Marschnerstr. 25 D-30167 Hannover mailto:reinhard.kotucha@web.de ---------------------------------------------------------------------------- Microsoft isn't the answer. Microsoft is the question, and the answer is NO. ----------------------------------------------------------------------------
participants (3)
-
Manuel Pégourié-Gonnard
-
Reinhard Kotucha
-
Taco Hoekwater