[tex-k] Unsupported extra colon in kpsewhich --expand-path

Heiko Oberdiek oberdiek at uni-freiburg.de
Mon Dec 17 09:45:17 CET 2007


On Sun, Dec 16, 2007 at 07:23:34PM -0600, Karl Berry wrote:

>     * Basically unknown output format, e.g. path separator.
> 
> If all you're complaining about is that the doc doesn't say one way or
> another (which I realize is the case), then that is easily solved;
> except I don't have any way to try it on Windows.  Does --show-path's
> output use ; there?  (I could not quickly tell from the implementation.)

A test with TL2007 showed `;'.

>     However it could be part of the solution:
> 
> How about describing what the problem is?  It would be nice to have some
> understanding of your underlying goals for all these rather intensive
> questions.  I gather all this is about Lua access?

Quite simple, I want to use Lua's module system:
  require("abc.def.ghi")
Would load "abc/def/ghi.lua".
The natural choice seems to be
  TDS:scripts/abc/def/ghi.lua
or
  TDS:scripts/foobar/abc/def/ghi.lua
if "foobar" is the package where the module belongs.
Of course there could be other modules in other packages, e.g.:
  TDS:scripts/hello/ghi.lua
  ...
Therefore it is not enough to search for "ghi.lua" without subdirs.

>     1. A function would be nice that does not concatenate the result,
>        but returns an array. Then LuaTeX could return a table.
> 
> That sounds easy enough, although if you are potentially accessing mere
> "functions", that sounds like you're linking with the library.

Taco has written some wrappers for kpathsea (kpse.find_file,
kpse.expand_path, ...).

> In which
> case, I don't know why you care about kpsewhich at all, since you
> already have access to everything there is.

I was looking for an easier way instead of reprogramming kpathsea
from scratch. Therefore I have asked on the lists -- I am not
an expert for kpathsea.

>        Remains the questions about the possible output formats:
>        * Preceding '!!'
>        * Directory separator?
>        * '//'?
> 
> I'm sorry, you're being too laconic for me.

show_path ::= empty
            | show_path path_separator path_spec
            ;
path_spec ::= '!!'? path
            ;
path      ::= unspec_path
            | unspec_path dir_separator
            | unspec_path '//'
            | <unknown>
            ;

path_separator is ':' for Unix and ';' for Windows. Other OSes?
unspec_path is something that does not end in a directory separator
(neglecting '/' as root directory in Unix).
dir_separator is '/' for Unix and '/' or '\' for Windows? Other OSes?
Infinite subdirectory searching always uses '//' or it is OS dependent?

> What --show-path does is
> simply show the actual path that is searched for the given format.  Is
> that not what you want?  It comes out of texmf.cnf, basically.

Yes. But I would need to parse the output by a program, not by human
intuition. Thus my question was about possible output formats.

>     3. `kpathsea --path' doesn't seem to support '!!'.
> 
> I believe you.  Again, I guess I need to understand what you're trying
> to do to understand why this matters.

I think it is more efficient to check a database (ls-R) instead of
inspecting each directory.

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>


More information about the tex-k mailing list