[Dev-luatex] kpse.find_file

Reinhard Kotucha reinhard.kotucha at web.de
Sun Nov 1 22:03:37 CET 2009

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 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 dev-luatex mailing list