On page 27, the kpathsea manual states:
- [A search path is a colon-separated list of path elements.]
- ...
- To check a particular path element
e
, Kpathsea first sees if a prebuilt database applies toe
, i.e., if the database is in a directory that is a prefix ofe
. If so, the path specification is matched against the contents of the database.
A few things aren't clear in the last sentence of this description. I'd be much obliged if somebody could point me to a more accurate description or provide an explanation how it works. The following are some questions I have.
- The path element
e
may have several prefixes. In what order are they searched? For example, ife
is equal to/a/b/c
, then/a
and/a/b
are both prefixes ofe
. (I suspect the order is given by: longest prefix first ... shortest prefix last.) - Is
e
a prefix of itself? (I supect yes.)
The following is a possible solution to Question 1. Could it be that there is an implicit assumption that there may be at most one prefix of any path element that can may an ls-R
database? If so, should the directory containing the ls-R
database be in TEXMFDBS
? It would make sense. For example, find /usr/local/texlive -name ls-R
gives:
/usr/local/texlive/texmf-local/ls-R
/usr/local/texlive/2011/texmf/ls-R
/usr/local/texlive/2011/texmf-dist/ls-R
/usr/local/texlive/2011/texmf-var/ls-R
/usr/local/texlive/2011/texmf-config/ls-R
and kpsewhich -var-value=TEXMFDBS
gives:
{!!/usr/local/texlive/2011/texmf-config,
!!/usr/local/texlive/2011/texmf-var,
!!/usr/local/texlive/2011/texmf,
!!/usr/local/texlive/2011/../texmf-local,
!!/usr/local/texlive/2011/texmf-dist}
EDIT (2 March, 2012) I sent an email to the kathsea
mailing list. I got a reply from Karl Berry suggesting that there should be no more than one ls-R
database along one path leading from the root to any leaf. Also, the directory containing the ls-R database should be in TEXMFDBS
.