diff options
author | Karl Berry <karl@freefriends.org> | 2007-12-24 00:52:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-12-24 00:52:32 +0000 |
commit | bf57c62ac76b4e26fdd833e56e77837b2546435b (patch) | |
tree | 2740b5368a798f2e4098717a1f8be729af729010 /Build | |
parent | f8612573e31eba1f04cf0450cbbae83f50ab3e6c (diff) |
finish implementing --subdir
git-svn-id: svn://tug.org/texlive/trunk@5851 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/kpathsea/.gdbinit | 6 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 2 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/kpsewhich.c | 29 |
3 files changed, 29 insertions, 8 deletions
diff --git a/Build/source/texk/kpathsea/.gdbinit b/Build/source/texk/kpathsea/.gdbinit index cb95f4193fc..cd6be579252 100644 --- a/Build/source/texk/kpathsea/.gdbinit +++ b/Build/source/texk/kpathsea/.gdbinit @@ -4,11 +4,11 @@ end # afoot.sty set env TEXMFCNF /home/texlive/karl/Master/texmf/web2c -set env TEXMFDBS /home/texlive/karl/Master/texmf-dist:/home/texlive/karl/Master/texmf -set env TEXINPUTS !!/home/texlive/karl/Master/texmf-dist/tex/latex//:!!/home/texlive/karl/Master/texmf/tex/generic//:!!/home/texlive/karl/Master/texmf/tex// +set env TEXMFDBS /home/texlive/karl/Master/texmf-dist +set env TEXINPUTS !!/home/texlive/karl/Master/texmf-dist/tex/latex// +set args --all --subdir=latex/arabtex --subdir=ledmac afoot.sty # # preload.cfg #set env TEXMFDBS /home/texlive/karl/Master/texmf #set env TEXINPUTS !!/home/texlive/karl/Master/texmf/tex/generic//:!!/home/texlive/karl/Master/texmf/tex// # --debug=32 -set args --all --subdir=tex/latex/base preload.cfg diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index c5ad6292092..89456f558be 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,6 +1,6 @@ 2007-12-23 Karl Berry <karl@tug.org> - * kpsewhich.c (subdir_match): start implementation. + * kpsewhich.c (subdir_match): new fn. (lookup): call it if requested. (subdir_paths): new global. (read_command_line): new option --subdir. diff --git a/Build/source/texk/kpathsea/kpsewhich.c b/Build/source/texk/kpathsea/kpsewhich.c index b0ac0dddc75..01dcd8a89ba 100644 --- a/Build/source/texk/kpathsea/kpsewhich.c +++ b/Build/source/texk/kpathsea/kpsewhich.c @@ -183,10 +183,31 @@ subdir_match P2C(str_list_type, subdirs, string *, matches) unsigned m; for (m = 0; matches[m]; m++) { - string s = matches[m]; - ret = XRETALLOC (ret, len + 1, string); - ret[len-1] = s; - len++; + unsigned loc; + unsigned e; + string s = xstrdup (matches[m]); + for (loc = strlen (s); loc > 0 && !IS_DIR_SEP (s[loc-1]); loc--) + ; + while (IS_DIR_SEP (s[loc-1])) { + loc--; + } + s[loc] = 0; /* wipe out basename */ + + for (e = 0; e < STR_LIST_LENGTH (subdirs); e++) { + string subdir = STR_LIST_ELT (subdirs, e); + unsigned subdir_len = strlen (subdir); + while (subdir_len > 0 && IS_DIR_SEP (subdir[subdir_len-1])) { + subdir_len--; + subdir[subdir_len] = 0; /* remove trailing slashes from subdir spec */ + } + if (FILESTRCASEEQ (subdir, s + loc - subdir_len)) { + /* matched, save this one. */ + ret = XRETALLOC (ret, len + 1, string); + ret[len-1] = matches[m]; + len++; + } + } + free (s); } ret[len-1] = NULL; return ret; |