[tex-k] accessing MySQL w/kpathsea

Karl Berry karl at freefriends.org
Wed Jun 11 03:57:26 CEST 2008


    It seems that at least for the moment, Luatex is still working using
    kpathsea:

Others know better than me, but my understanding is that there is a mode
in which you can turn off the original libkpathsea C functions, and
instead use Hans' reimplementation in Lua.  (Thankfully, this is not the
default, or luatex wouldn't be remotely compatible with the rest of the
distribution.)  

I do believe that Hans has already implemented a mode where the files
will be found *inside* a .zip archive (or whatever).  Perhaps that could
be adapted to db lookups.  In any case, you might indeed find it more
rewarding to program your work in Lua instead of C.

Anyway, back to your original question, which is more or less
independent of the above, seems to me.

    ".:/usr/local/texmf:[[database=mysql,dbserver='localhost',dbusername='USERNAME',dbpassword='PASSWORD',query='SELECT

Sounds vaguely possible, I guess.  But you realize there are potentially
hundreds of files being read?  Fonts, .fmt files, etc.?  Are you going
to put the entire TeX tree into your database?  Yikes.  Well, I wish you
luck :).

    As I understand it, the way it works is that it gets handed a string
    such as the following:

In broad strokes, yes.  There are also ls-R files, !! specifications,
and more that affect the searching.

    currently accessed file into a nice *.tar.gz 

Just BTW, that's possible now, with (e.g.), pdftex -recorder.

    it would need to be closed

Won't it close automatically when the process exits?
Or else I suppose you could register some atexit kind of thing.

    Do similar projects exist already?

Not that I've ever heard of.

    maybe you can tell me whether I'm looking in vain and should rather
    start somewhere else…

If all you want to do is manipulate your input files in a db, I'd just
write a wrapper around TeX that does the extraction instead of changing
kpathsea at all.  I can't say what specific issues you will run into,
but it seems inevitable that the whole thing will become quite a large
project.

Best,
Karl


More information about the tex-k mailing list