diff options
author | Karl Berry <karl@freefriends.org> | 2007-09-18 18:07:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-09-18 18:07:32 +0000 |
commit | d48fdb47c2b84e93e19ba16d13a96198144441dd (patch) | |
tree | 6fa6e4d0c6cc7e259ce5af75201a7d88dd9baa49 /Build/tools | |
parent | d13e34299b858d5d71cce15a2b39b36bd575af21 (diff) |
(tlpsrc_find_catalogue): new fn.
(find_ctan_dir): call it.
git-svn-id: svn://tug.org/texlive/trunk@4972 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/tools')
-rwxr-xr-x | Build/tools/tlpkginfo | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Build/tools/tlpkginfo b/Build/tools/tlpkginfo index a95ac290ad1..d1e9d3d377e 100755 --- a/Build/tools/tlpkginfo +++ b/Build/tools/tlpkginfo @@ -42,6 +42,9 @@ sub find_ctan_dir if ($me =~ /^(ams|amscls|amsltx2|amsmath|amsrefs)$/) { $me = "amslatex"; } + + # use explicit catalogue name if given in tlpsrc. + $me = &tlpsrc_find_catalogue ($me) || $me; # The CTAN path to a package is sometimes stored in the TeX Catalogue, # but old entries don't have it, etc. Still, we want to use it if present. @@ -126,6 +129,28 @@ sub find_ctan_dir return $ctan_dir ? 0 : 1; } + + +# If the .tlpsrc file for ME has a catalogue entry, return it. +# Else return empty string. +# +sub tlpsrc_find_catalogue +{ + my ($me) = @_; + + chomp (my $mydir = `dirname $0`); + chomp (my $tlpsrcdir = `cd $mydir/../../Master/tlpkg/tlpsrc && /bin/pwd`); + my $tlpsrc = "$tlpsrcdir/$me.tlpsrc"; + if (! -r $tlpsrc) { + warn "$0: no tlpsrc $tlpsrc\n"; + return ""; + } + + chomp (my $cat = `awk '\$1 == "catalogue" {print \$2}' $tlpsrc`); + return $cat; +} + + # look up ctan path for given package name in catalogue entry. # xml is too hard to parse, so just look for the <ctan path...> entry. |