texlive[51718] Master/tlpkg/bin/tlpkginfo: doc fixes

commits+karl at tug.org commits+karl at tug.org
Wed Jul 24 20:18:42 CEST 2019


Revision: 51718
          http://tug.org/svn/texlive?view=revision&revision=51718
Author:   karl
Date:     2019-07-24 20:18:42 +0200 (Wed, 24 Jul 2019)
Log Message:
-----------
doc fixes

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkginfo

Modified: trunk/Master/tlpkg/bin/tlpkginfo
===================================================================
--- trunk/Master/tlpkg/bin/tlpkginfo	2019-07-24 04:58:57 UTC (rev 51717)
+++ trunk/Master/tlpkg/bin/tlpkginfo	2019-07-24 18:18:42 UTC (rev 51718)
@@ -3,9 +3,12 @@
 # Public domain.  Originally written 2005, Karl Berry.
 # 
 # Return information given a TL package name (i.e., a tlpsrc file name).
+# This requires local copies of CTAN and the TeX Catalogue. This program
+# needs to be refactored with ctan2tl and ctan2ds, as we currently
+# actually unpack .tds.zip files, etc., which does not seem right.
+# 
 # With -rev (--revision) argument given, returns only the revision number
-# of the package (see below for details).
-# We require local copies of CTAN and the TeX Catalogue.
+# of a given package (see below for details).
 
 BEGIN {
   $^W = 1;
@@ -26,13 +29,14 @@
 sub tlpkgrevision {
   # output and exit codes:
   # repository not found or no modules available there
-  #	output: -1	exit code: 1
+  #	stdout: -1	exit code: 1
   #	stderr warning
   # package not found:
-  #	output: 0	exit code: 1
+  #	stdout: 0	exit code: 1
   #	stderr warning
   # both found
-  #	output: rev	exit code: 0
+  #	stdout: rev#	exit code: 0
+  #	(no newline on stdout)
   #
   #   tlpkginfo -revision <pkg> [ <tltree> ]
   require TeXLive::TLPOBJ;
@@ -45,13 +49,13 @@
   }
   my $tlpdb = TeXLive::TLPDB->new ("root" => $root);
   if (!defined($tlpdb)) {
-    printf STDERR "Cannot find tlpdb in $root\n";
+    printf STDERR "$0: Cannot find tlpdb in TL root dir $root\n";
     print "-1";
     exit(1);
   }
   my $pkg = $tlpdb->get_package($ARGV[1]);
   if (!defined($pkg)) {
-    printf STDERR "Cannot find $ARGV[1] package\n";
+    printf STDERR "Cannot find package $ARGV[1] in TL tree of $root\n";
     print "0";
     exit(1);
   }
@@ -104,6 +108,7 @@
   } else {
     die "Usage: $0 --ctan-dir PKGNAME\n" 
       . "   or:  --prepare PKGNAME\n"
+      . "   or:  --revision PKGNAME [TLROOT]\n"
       . "   or:  --ctan-root\n"
       . "(not \"@ARGV\").\n";
   }
@@ -317,7 +322,11 @@
   # extract just the dir or file name, without options, etc.
   $ctan_path =~ m,path=(["'])/(.*?)\1,;
   $ctan_loc = $2;
-  return undef unless $ctan_loc; # should never happen, but who knows
+  if (! $ctan_loc) {
+    # should never happen, but who knows
+    warn "$0: no ctan_loc found in $ctan_path?!\n";
+    return;
+  }
 
   # if the Catalogue lists the path as a single file, there are two
   # possibilities: (1) it really is a single file, e.g., texilikecover,
@@ -330,6 +339,7 @@
   # babel-contrib/hungarian.  Sigh.
   # 
 #warn "catalogue ctan path $ctan_path, pkg $pkgname\n";
+#warn "catalogue ctan loc $ctan_loc\n";
   my $ret;
   if ($ctan_path =~ /file='true'/) {
     (my $ctan_babel_path = $ctan_path) =~ s,babel-contrib/,babel-,;
@@ -367,7 +377,7 @@
   # tds path is usually in ctan/install...
   my $tds_path = $ctan_loc ? "$ctan_loc.tds.zip" : "";
   $tds_path =~ s,^$CTAN,$CTAN/install,;
-
+#warn "prepare: tds_path for $pkg = $tds_path\n";
   # ...except for heiko, when running on tug.org...
   if ($pkg =~ /^($oberdiek_tds)$/) {
     $tds_path = "/home/ftp/tex/$pkg/$pkg.tds.zip";



More information about the tex-live-commits mailing list