texlive[43825] Master/install-tl: cleaner profile reading and writing

commits+preining at tug.org commits+preining at tug.org
Sun Apr 16 04:13:23 CEST 2017


Revision: 43825
          http://tug.org/svn/texlive?view=revision&revision=43825
Author:   preining
Date:     2017-04-16 04:13:23 +0200 (Sun, 16 Apr 2017)
Log Message:
-----------
cleaner profile reading and writing

Modified Paths:
--------------
    trunk/Master/install-tl

Modified: trunk/Master/install-tl
===================================================================
--- trunk/Master/install-tl	2017-04-16 02:13:17 UTC (rev 43824)
+++ trunk/Master/install-tl	2017-04-16 02:13:23 UTC (rev 43825)
@@ -1757,6 +1757,7 @@
     print $fh "$key $vars{$key}\n"
         if $save_cols and $key=~/^collection/ and $vars{$key}==1;
     print $fh "$key $vars{$key}\n" if $key =~ /^option_/;
+    print $fh "$key $vars{$key}\n" if $key =~ /^instopt_/;
     print $fh "$key $vars{$key}\n" if (($key =~ /^binary_/) && $vars{$key});
     print $fh "$key $vars{$key}\n" if $key =~ /^TEXDIR/;
     print $fh "$key $vars{$key}\n" if $key =~ /^TEXMFSYSVAR/;
@@ -1765,7 +1766,6 @@
     print $fh "$key $vars{$key}\n" if $key =~ /^TEXMFCONFIG/;
     print $fh "$key $vars{$key}\n" if $key =~ /^TEXMFLOCAL/;
     print $fh "$key $vars{$key}\n" if $key =~ /^TEXMFHOME/;
-    print $fh "$key $vars{$key}\n" if $key =~ /^instopt_portable/;
   }
   if (!ref($profilepath)) {
     close PROFILE;
@@ -1785,10 +1785,34 @@
     $pro{$k} = $v;
   }
   foreach (keys %vars) {
-    # clear out collections from var
+    # clear out collections from var, just to be sure
     if (m/^collection-/) { $vars{$_} = 0; }
-    if (defined($pro{$_})) { $vars{$_} = $pro{$_}; }
   }
+  # initialize installer and tlpdb options
+  foreach (keys %pro) {
+    if (m/^instopt_/) {
+      if (defined($vars{$_})) {
+        $vars{$_} = $pro{$_};
+        delete($pro{$_});
+      }
+    }
+    if (m/^option_/) {
+      my $o = $_;
+      $o =~ s/^option_//;
+      if (defined($TeXLive::TLConfig::TLPDBOptions{$o})) {
+        $vars{$_} = $pro{$_};
+        delete($pro{$_});
+      }
+    }
+  }
+  # if there are still keys in the %pro array, some unknown keys have
+  # been written in the profile, bail out
+  if (my @foo = keys(%pro)) {
+    tlwarn("Unknown key in profile $profilepath: @foo\n");
+    tlwarn("Stopping here.\n");
+    exit(1);
+  }
+
   # if a profile contains *only* the selected_scheme setting without
   # any collection, we assume that exactely that scheme should be installed
   my $coldefined = 0;



More information about the tex-live-commits mailing list