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

commits+preining at tug.org commits+preining at tug.org
Tue May 2 23:11:59 CEST 2017


Revision: 44153
          http://tug.org/svn/texlive?view=revision&revision=44153
Author:   preining
Date:     2017-05-02 23:11:59 +0200 (Tue, 02 May 2017)
Log Message:
-----------
suggestions from Karl for tlmgr shell

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-05-02 17:42:49 UTC (rev 44152)
+++ trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2017-05-02 21:11:59 UTC (rev 44153)
@@ -5908,7 +5908,10 @@
       my $dest = shift @args;
       print "ERROR not implemented: $cmd\n";
     } elsif ($cmd =~ m/^(set|get)$/) {
-      my @valid_keys = qw/repository debug-translation machine-readable no-execute-actions require-verification verify-downloads/;
+      my @valid_bool_keys = qw/debug-translation machine-readable no-execute-actions require-verification verify-downloads/;
+      my @valid_string_keys = qw/repository/;
+      my @valid_keys = @valid_bool_keys;
+      push @valid_keys, @valid_string_keys;
       my $key = shift @args;
       my $val = shift @args;
       if (!$key) {
@@ -5946,9 +5949,16 @@
           }
         }
         print "OK\n";
-      } elsif ($key =~ m/^(debug-translation|machine-readable|no-execute-actions|require-verification|verify-downloads)$/) {
+      } elsif (TeXLive::TLUtils::member($key, @valid_bool_keys)) {
         if ($cmd eq "set") {
-          $opts{$key} = ($val eq "1" ? 1 : 0);
+          if ($val eq "0") {
+            $opts{$key} = 0;
+          } elsif ($val eq "1") {
+            $opts{$key} = 1;
+          } else {
+            print "ERROR invalid value $val for key $key\n";
+            next;
+          }
           # special cases
           $::debug_translation = $opts{"debug-translation"};
           $::machinereadable = $opts{"machine-readable"};



More information about the tex-live-commits mailing list