diff options
author | Norbert Preining <preining@logic.at> | 2008-09-25 15:43:49 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-09-25 15:43:49 +0000 |
commit | 4332ab848d71e288320c0e44f889fea6df0e9c6e (patch) | |
tree | 0dda9abe0a8143bef51fdae7d69ed94ea1763933 /Master/tlpkg | |
parent | 30126a31f57eb919559f3e2ce37d3ff7dc677561 (diff) |
add a remove removed packages support to tlmgr
git-svn-id: svn://tug.org/texlive/trunk@10730 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/etc/remove-removed-packages.diff | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Master/tlpkg/etc/remove-removed-packages.diff b/Master/tlpkg/etc/remove-removed-packages.diff new file mode 100644 index 00000000000..7853851057c --- /dev/null +++ b/Master/tlpkg/etc/remove-removed-packages.diff @@ -0,0 +1,58 @@ +Index: tlmgr.pl +=================================================================== +--- tlmgr.pl (revision 10729) ++++ tlmgr.pl (working copy) +@@ -650,8 +650,40 @@ + unlink($f) unless $opt_dry; + } + my @todo; ++ my @removal = (); + if ($opt_all || $opt_list) { + @todo = $localtlpdb->list_packages; ++ # we check for deleted packages by checking: ++ # . the package is referenced by collection of the local tlpdb ++ # . the package is present in the local tlpdb ++ # . the collection is present in the remote tlpdb ++ # . the package is not referenced any more in the remote tlpdb ++ for my $c ($localtlpdb->collections) { ++ my $tlcremote = $mediatlpdb->get_package($c); ++ # continue with next package if the local connection is not ++ # present on the server side ++ next if !defined($tlcremote); ++ my $tlc = $localtlpdb->get_package($c); ++ die ("That should not happen, listed but not found!") if !defined($tlc); ++ # take all the dependencies of the installed collection ++ # *as*found* in the network tlpdb ++ for my $d ($tlc->depends) { ++ my $tlp = $localtlpdb->get_package($d); ++ if (!defined($tlp)) { ++ info("forcibly removed $d, mentioned in $c\n"); ++ } else { ++ # now check the remote tlpdb for reference of that package ++ if (!defined($mediatlpdb->get_package($d))) { ++ # it seems that the package is present in the local tlpdb ++ # is referenced in $c in the local tlpdb ++ # $c is present in the remote tlpdb ++ # the package is NOT present in the remote tlpdb ++ info("$d ($c): removed package\n"); ++ push @removal, $d; ++ } ++ } ++ } ++ } + } else { + @todo = @ARGV; + } +@@ -838,6 +870,12 @@ + next; + } + } ++ # remove the packages that have disappeared ++ for my $p (@removal) { ++ info("remove $p (removed on server)\n"); ++ merge_into(\%ret, &remove_package($p, $localtlpdb, 1)) unless ++ ($opt_dry or $opt_list); ++ } + if ($updater_started) { + print UPDATER "del tlpkg\\installer\\tarsave.exe\n"; + print UPDATER "rem del /s /q temp\n"; |