texlive[43821] Master/install-tl: if scheme/collection selection

commits+preining at tug.org commits+preining at tug.org
Sun Apr 16 04:12:54 CEST 2017


Revision: 43821
          http://tug.org/svn/texlive?view=revision&revision=43821
Author:   preining
Date:     2017-04-16 04:12:54 +0200 (Sun, 16 Apr 2017)
Log Message:
-----------
if scheme/collection selection fits, save only scheme info

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

Modified: trunk/Master/install-tl
===================================================================
--- trunk/Master/install-tl	2017-04-16 02:12:47 UTC (rev 43820)
+++ trunk/Master/install-tl	2017-04-16 02:12:54 UTC (rev 43821)
@@ -1730,6 +1730,27 @@
     open PROFILE, ">$profilepath";
     $fh = \*PROFILE;
   }
+  #
+  # determine whether the set of selected collections exactly 
+  # agrees with the selected scheme. In this case we do *not*
+  # save the actual collection setting but only the selected
+  # scheme, as reading the profile will load all collections
+  # if only the scheme is given.
+  my %instcols;
+  foreach my $key (sort keys %vars) {
+    $instcols{$key} = 1 if $key=~/^collection/ and $vars{$key}==1;
+  }
+  my $scheme=$tlpdb->get_package($vars{'selected_scheme'});
+  if (!defined($scheme)) {
+    die ("Scheme $vars{selected_scheme} not defined.\n");
+  }
+  for my $scheme_content ($scheme->depends) {
+    delete($instcols{"$scheme_content"}) if ($scheme_content=~/^collection-/);
+  }
+  # if there are still collection left, we keep all of them
+  my $save_cols = (keys(%instcols) ? 1 : 0);
+
+  # start
   my $tim = gmtime(time);
   print $fh "# texlive.profile written on $tim UTC\n";
   print $fh "# It will NOT be updated and reflects only the\n";
@@ -1737,7 +1758,7 @@
   print $fh "selected_scheme $vars{selected_scheme}\n";
   foreach my $key (sort keys %vars) {
     print $fh "$key $vars{$key}\n"
-        if $key=~/^collection/ and $vars{$key}==1;
+        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 =~ /^binary_/) && $vars{$key});
     print $fh "$key $vars{$key}\n" if $key =~ /^TEXDIR/;



More information about the tex-live-commits mailing list