texlive[43828] Master/install-tl: profile reading revised

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


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

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

Modified: trunk/Master/install-tl
===================================================================
--- trunk/Master/install-tl	2017-04-16 02:13:38 UTC (rev 43827)
+++ trunk/Master/install-tl	2017-04-16 02:13:45 UTC (rev 43828)
@@ -150,6 +150,16 @@
         'instopt_path' => 0,
     );
 
+my %path_keys = (
+  'TEXMFLOCAL' => 1,
+  'TEXMFCONFIG' => 1,
+  'TEXMFSYSCONFIG' => 1,
+  'TEXMFVAR' => 1,
+  'TEXMFSYSVAR' => 1,
+  'TEXDIR' => 1,
+  'TEXMFHOME' => 1,
+);
+
 # option handling
 our $opt_in_place = 0;
 my $opt_gui = (win32() ? "wizard" : "text");
@@ -479,7 +489,7 @@
 

 if ($opt_profile eq "") {
   if ($opt_profileseed) {
-    read_profile("$opt_profileseed");
+    read_profile("$opt_profileseed", seed => 1);
   }
   # do the normal interactive installation.
   #
@@ -1754,14 +1764,8 @@
         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 defined($path_keys{$key});
     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/;
-    print $fh "$key $vars{$key}\n" if $key =~ /^TEXMFSYSCONFIG/;
-    print $fh "$key $vars{$key}\n" if $key =~ /^TEXMFVAR/;
-    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/;
   }
   if (!ref($profilepath)) {
     close PROFILE;
@@ -1770,6 +1774,7 @@
 
 sub read_profile {
   my $profilepath = shift;
+  my %opts = @_;
   open PROFILE, "<$profilepath"
     or die "$0: Cannot open profile $profilepath for reading.\n";
   my %pro;
@@ -1791,6 +1796,7 @@
         $vars{$_} = $pro{$_};
         delete($pro{$_});
       }
+      next;
     }
     if (m/^option_/) {
       my $o = $_;
@@ -1799,7 +1805,19 @@
         $vars{$_} = $pro{$_};
         delete($pro{$_});
       }
+      next;
     }
+    if (defined($path_keys{$_}) || m/^selected_scheme$/) {
+      $vars{$_} = $pro{$_};
+      delete($pro{$_});
+      next;
+    }
+    if (m/^binary_/) {
+      # we do not do any checking of validity of binaries!
+      $vars{$_} = $pro{$_};
+      delete($pro{$_});
+      next;
+    }
   }
   # if there are still keys in the %pro array, some unknown keys have
   # been written in the profile, bail out
@@ -1820,6 +1838,9 @@
   }
   # if at least one collection has been defined return here
   return if $coldefined;
+  # if we are in seed mode, do not try to load remote db as it is 
+  # not initialized by now
+  return if $opts{'seed'};
   # since no collections have been defined in the profile, we
   # set those to be installed on which the scheme depends
   my $scheme=$tlpdb->get_package($vars{'selected_scheme'});



More information about the tex-live-commits mailing list