summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBuild/tools/tlpkginfo25
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.