summaryrefslogtreecommitdiff
path: root/Build/tools/tlpkginfo
diff options
context:
space:
mode:
Diffstat (limited to 'Build/tools/tlpkginfo')
-rwxr-xr-xBuild/tools/tlpkginfo18
1 files changed, 14 insertions, 4 deletions
diff --git a/Build/tools/tlpkginfo b/Build/tools/tlpkginfo
index 6f7cd019d3a..b76ea86bddd 100755
--- a/Build/tools/tlpkginfo
+++ b/Build/tools/tlpkginfo
@@ -121,10 +121,20 @@ sub catalogue_find_ctan_path
my $catfile = "$CATALOGUE/$firstchar/$pkgname.xml";
return undef unless -r $catfile;
- my $ctan_path
- = `sed -n -e "s,'/>,," -e "s,' .*,," -e "s,^ *<ctan path='/,,p" $catfile`;
- return undef unless $ctan_path;
-
+ # get the raw line from the catalogue file. (let's hope it's one line.)
+ my $ctan_path = `sed -n "s,^ *<ctan path='/,,p" $catfile`;
+ return undef unless $ctan_path; # in case it's not present at all
+
+ # if it's just a single file, we aren't prepared to deal with it.
+ # ifxetex, for example, is given as a single file even though it has
+ # its own directory, so we find it with the code above. (The
+ # Catalogue maintainers do not consider this a problem for various reasons.)
+ return undef if $ctan_path =~ /file='true'/;
+
+ # ok, we will use the ctan path. chop off any options, etc.
+ $ctan_path =~ s,'/>,,;
+ $ctan_path =~ s,' .*,,;
chomp ($ctan_path);
+
return $ctan_path;
}