From 80b170661b7b5abc3ea0f8264c965faac6374a7d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 16 Apr 2017 02:12:54 +0000 Subject: if scheme/collection selection fits, save only scheme info git-svn-id: svn://tug.org/texlive/trunk@43821 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'Master') diff --git a/Master/install-tl b/Master/install-tl index f7dac723073..67355db087f 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -1730,6 +1730,27 @@ sub create_profile { 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 @@ sub create_profile { 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/; -- cgit v1.2.3