diff options
author | Norbert Preining <preining@logic.at> | 2008-11-13 00:33:25 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-11-13 00:33:25 +0000 |
commit | 6dc368153b74ea1e1b642558f49716aa643f8c39 (patch) | |
tree | 6387d75aff94553999a95b4c44a7f28946c7f167 | |
parent | cbd7eee2ee64d42155fc217faff3156417a42ce3 (diff) |
fix tlmgr logic again ...
git-svn-id: svn://tug.org/texlive/trunk@11274 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index d9029e7a5aa..7f25146df1b 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -335,20 +335,12 @@ sub handle_ret_hash # tlpobj files) and the entry from the tlpdb. # sub remove_package { - my ($pkg, $localtlpdb, $force) = @_; + my ($pkg, $localtlpdb) = @_; my $tlp = $localtlpdb->get_package($pkg); my %ret; if (!defined($tlp)) { tlwarn ("$pkg: package not present, cannot remove\n"); } else { - if (!$force) { - # do some checking - my @needed = $localtlpdb->needed_by($pkg); - if (@needed) { - tlwarn ("$pkg: not removed, referenced in @needed\n"); - return; - } - } if ($pkg =~ m/^texlive\.infra/) { log ("Not removing $pkg, it is essential!\n"); return; @@ -501,14 +493,23 @@ sub action_remove { my @neededpacks = $localtlpdb->expand_dependencies($localtlpdb, keys %allpacks); my %packs; my %origpacks; - for my $p (@ARGV) { $origpacks{$p} = 1; } + my @origpacks = $localtlpdb->expand_dependencies("-only-arch", $localtlpdb, @ARGV) unless $opt_reallynodepends; + for my $p (@origpacks) { $origpacks{$p} = 1; } for my $p (@packs) { $packs{$p} = 1; } for my $p (@neededpacks) { - delete($packs{$p}); if (defined($origpacks{$p})) { + # that package was asked for to be removed on the cmd line my @needed = $localtlpdb->needed_by($p); - tlwarn("tlmgr: not removing $p, needed by " . - join(" ", @needed) . "\n"); + if ($opt_force) { + info("tlmgr: $p is needed by " . join(" ", @needed) . "\n"); + info("tlmgr: still removing it due to --force\n"); + } else { + delete($packs{$p}); + tlwarn("tlmgr: not removing $p, needed by " . + join(" ", @needed) . "\n"); + } + } else { + delete($packs{$p}); } } @packs = keys %packs; @@ -530,7 +531,7 @@ sub action_remove { # the rest will not be run in dry_run mode $foo{'mktexlsr'} = 1; } else { - merge_into(\%foo, &remove_package($pkg, $localtlpdb, $opt_force)); + merge_into(\%foo, &remove_package($pkg, $localtlpdb)); logpackage("remove: $pkg"); } if (keys %foo) { @@ -553,7 +554,7 @@ sub action_remove { info ("remove $pkg\n"); if (!$opt_dry) { my %foo; - merge_into(\%foo, &remove_package($pkg, $localtlpdb, $opt_force)); + merge_into(\%foo, &remove_package($pkg, $localtlpdb)); if (keys %foo) { # removal was successful logpackage("remove: $pkg"); @@ -754,9 +755,8 @@ sub action_restore { init_local_db(1); # first remove the package, then reinstall it # this way we get rid of useless files - # force the deinstallation since we will reinstall it $opt_backupdir = abs_path($opt_backupdir); - merge_into(\%ret, &remove_package($pkg, $localtlpdb, 1)); + merge_into(\%ret, &remove_package($pkg, $localtlpdb)); TeXLive::TLMedia->_install_package("$opt_backupdir/${pkg}.r${rev}.tar.lzma" , [] ,$localtlpdb); logpackage("restore: $pkg ($rev)"); # now we have to read the .tlpobj file and add it to the DB @@ -1203,7 +1203,7 @@ sub action_update { info("remove $p (removed on server)\n"); } if (!($opt_dry or $opt_list or $opt_noremove)) { - merge_into(\%ret, &remove_package($p, $localtlpdb, 1)); + merge_into(\%ret, &remove_package($p, $localtlpdb)); logpackage("remove: $p"); } } @@ -1325,7 +1325,7 @@ sub action_update { # # the remove_package should also remove empty dirs in case # a dir is changed into a file - merge_into(\%ret, &remove_package($pkg, $localtlpdb, 1)); + merge_into(\%ret, &remove_package($pkg, $localtlpdb)); my $foo = $tlmediasrc->install_package($pkg, $localtlpdb); if (ref $foo) { # installation succeeded because we got a reference |