texlive[45957] Master/texmf-dist/scripts/texlive/tlmgr.pl: tlmgr info

commits+preining at tug.org commits+preining at tug.org
Fri Dec 1 01:16:33 CET 2017


Revision: 45957
          http://tug.org/svn/texlive?view=revision&revision=45957
Author:   preining
Date:     2017-12-01 01:16:32 +0100 (Fri, 01 Dec 2017)
Log Message:
-----------
tlmgr info --data --only-installed: don't load remote

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl

Modified: trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2017-11-30 22:04:44 UTC (rev 45956)
+++ trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2017-12-01 00:16:32 UTC (rev 45957)
@@ -1514,8 +1514,10 @@
     # output format is changed to csv with " as quotes
     # we need to determine the fields
     @datafields = split(',', $opts{'data'});
-    # check for correctness of data fields
+    # check for correctness of data fields and whether remote is necessary
+    my $load_remote = 0;
     for my $d (@datafields) {
+      $load_remote = 1 if ($d eq "remoterev");
       if ($d !~ m/name|category|localrev|remoterev|shortdesc|longdesc|size|installed|relocatable|depends|cat-version|cat-date|cat-license/) {
         tlwarn("unknown data field: $d\n");
         return($F_ERROR);
@@ -1522,8 +1524,13 @@
       }
     }
     $fmt = "csv";
-    # the 1 is the silent mode!
-    init_tlmedia_or_die(1);
+    if ($load_remote) {
+      if ($opts{"only-installed"}) {
+        tlwarn("requesting only-installed with data field remoterev, loading remote anyway!\n");
+        $opts{"only-installed"} = 0;
+      }
+      # loading of tlpdb is done below
+    }
   } else {
     $fmt = "detail";
   }
@@ -3774,11 +3781,15 @@
   my ($p, @datafields) = @_;
   my @out;
   my $loctlp = $localtlpdb->get_package($p);
-  my $remtlp = $remotetlpdb->get_package($p);
+  my $remtlp = $remotetlpdb->get_package($p) unless ($opts{'only-installed'});
   my $is_installed = (defined($loctlp) ? 1 : 0);
   my $is_available = (defined($remtlp) ? 1 : 0);
   if (!($is_installed || $is_available)) {
-    tlwarn("$prg: package $p not found neither locally nor remote!\n");
+    if ($opts{'only-installed'}) {
+      tlwarn("$prg: package $p not locally!\n");
+    } else {
+      tlwarn("$prg: package $p not found neither locally nor remote!\n");
+    }
     return($F_WARNING);
   }
   my $tlp = ($is_installed ? $loctlp : $remtlp);



More information about the tex-live-commits mailing list