diff options
author | Norbert Preining <preining@logic.at> | 2011-05-07 03:31:12 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2011-05-07 03:31:12 +0000 |
commit | 99e4c3bfd93c49722b98e5ac720ce7543d88e984 (patch) | |
tree | 4b67efeced703ff13d71383a6f99e463759d92c7 /Master | |
parent | 0c0d83716cb3c13c774da7299553c31046ec5075 (diff) |
allow
auto-remove 0|1
in the tlmgr config file, to permanently disable auto-removal of packages
git-svn-id: svn://tug.org/texlive/trunk@22344 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 46844939021..3e022ef8ae5 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -2207,7 +2207,7 @@ sub action_update { # options --no-auto-remove, --no-auto-install, --reinstall-forcibly-removed my @option_conflict_lines = (); my $in_conflict = 0; - if (!$opts{"no-auto-remove"}) { + if (!$opts{"no-auto-remove"} && $config{"auto-remove"}) { for my $pkg (keys %removals) { for my $ep (@excluded_pkgs) { if ($pkg eq $ep || $pkg =~ m/^$ep\./) { @@ -2345,7 +2345,7 @@ sub action_update { # remove the packages that have disappeared: # we add that only to the list of total packages do be worked on # when --all is given, because we remove packages only on --all - if (!$opts{"no-auto-remove"}) { + if (!$opts{"no-auto-remove"} && $config{"auto-remove"}) { my @foo = keys %removals; $totalnr += $#foo + 1; } @@ -2433,8 +2433,8 @@ sub action_update { # REMOVALS # for my $p (keys %removals) { - if ($opts{"no-auto-remove"}) { - info("not removing $p due to -no-auto-remove (removed on server)\n"); + if ($opts{"no-auto-remove"} || !$config{"auto-remove"}) { + info("not removing $p due to -no-auto-remove or config file option (removed on server)\n"); } else { &ddebug("removing package $p\n"); my $pkg = $localtlpdb->get_package($p); @@ -4678,6 +4678,9 @@ sub load_config_file # the default for gui-expertmode is 1 since that is what we # have shipped till now $config{"gui-expertmode"} = 1; + # + # by default we remove packages + $config{"auto-remove"} = 1; chomp (my $TEXMFCONFIG = `kpsewhich -var-value=TEXMFCONFIG`); my $fn = "$TEXMFCONFIG/tlmgr/config"; @@ -4703,6 +4706,14 @@ sub load_config_file } } elsif ($key eq "gui-lang") { $config{'gui-lang'} = $val; + } elsif ($key eq "auto-remove") { + if ($val eq "0") { + $config{"auto-remove"} = 0; + } elsif ($val eq "1") { + $config{"auto-remove"} = 1; + } else { + tlwarn("Unknown value >$val< for auto-remove in $fn\n"); + } } else { tlwarn("Unknown key $key in $fn\n"); } |