summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/bin')
-rwxr-xr-xMaster/tlpkg/bin/tlpkginfo48
1 files changed, 31 insertions, 17 deletions
diff --git a/Master/tlpkg/bin/tlpkginfo b/Master/tlpkg/bin/tlpkginfo
index 04a354647b6..6167e5ed568 100755
--- a/Master/tlpkg/bin/tlpkginfo
+++ b/Master/tlpkg/bin/tlpkginfo
@@ -156,7 +156,6 @@ sub tlpsrc_find_catalogue
# 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.
-# Sometimes there is a single file, but worry about that later.
#
# Return the ctan path if found (without leading /), or undef.
#
@@ -177,6 +176,12 @@ sub catalogue_find_ctan_path
$ctan_loc =~ s,' .*,,;
chomp ($ctan_loc);
+ # if the package claims to have tds-ready .zip file, use it.
+ my $tds_path = "$CTAN/install/$ctan_loc.tds.zip";
+ if (-s $tds_path) {
+ return &copy_to_tmpdir ($pkgname, $tds_path);
+ }
+
# if the Catalogue lists the path as a single file, there are two
# possibilities: (1) it really is a single file, e.g., texilikecover,
# in which case we copy that file into a temp dir and return that temp
@@ -186,22 +191,31 @@ sub catalogue_find_ctan_path
# various reasons.)
#
if ($ctan_path =~ /file='true'/) {
- return undef if $ctan_path =~ m,/$pkgname/,; # pkg dir somewhere in path
-
- # ok, we will copy to temp dir.
- my $pkgdir = "$TMPDIR/tl.$pkgname";
- system ("rm -rf $pkgdir");
- mkdir ($pkgdir, 0777);
-
-# warn "$0: copying single file:\n";
-# warn "$0: $CTAN/$ctan_loc\n";
- unless (system ("cp -p '$CTAN/$ctan_loc' '$pkgdir/'") == 0) {
- warn "$0: copy of $CTAN/$ctan_loc to $pkgdir failed?!\n";
- return undef;
- }
- return $pkgdir;
+ return $ctan_path =~ m,/$pkgname/, # pkg dir somewhere in path?
+ ? undef
+ : &copy_to_tmpdir ($pkgname, "$CTAN/$ctan_loc");
}
-
- # ok, we will use the ctan path.
+
+ # no tds.zip, not a single file, so use the regular ctan location.
return $ctan_loc;
}
+
+
+# copy file to temp dir and return that for ctan2tl to use.
+#
+sub copy_to_tmpdir
+{
+ my ($pkgname,$src) = @_;
+
+ my $pkgdir = "$TMPDIR/tl.$pkgname";
+ system ("rm -rf $pkgdir");
+ mkdir ($pkgdir, 0777);
+
+ warn "$0: copying single file $src\n";
+ unless (system ("cp -p '$src' '$pkgdir/'") == 0) {
+ warn "$0: copy of $src to $pkgdir failed?!\n";
+ return undef;
+ }
+
+ return $pkgdir;
+}