summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-08 02:52:26 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-08 02:52:26 +0000
commit5c22fec8294f797b8039aa4bf0ced26e0fb1c5c4 (patch)
tree606cfee9c3fb6085133ffd9095b9f21f4e3c7010 /bin
parent1a5783ef25db41d8cfbe9aa516d28ea47d934b14 (diff)
downloadportage-5c22fec8294f797b8039aa4bf0ced26e0fb1c5c4.tar.gz
portage-5c22fec8294f797b8039aa4bf0ced26e0fb1c5c4.tar.bz2
portage-5c22fec8294f797b8039aa4bf0ced26e0fb1c5c4.zip
For bug #184412, make depclean more consistent with the update algorithm by keeping the highest version that as visible in the portage tree and pruning any versions that are either masked or no longer exist in the portage tree. (trunk r7195)
svn path=/main/branches/2.1.2/; revision=7196
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge
index c86e16c7b..30541ef6d 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -5097,6 +5097,7 @@ def action_depclean(settings, trees, ldpath_mtimes,
xterm_titles = "notitles" not in settings.features
myroot = settings["ROOT"]
+ portdb = trees[myroot]["porttree"].dbapi
dep_check_trees = {}
dep_check_trees[myroot] = {}
dep_check_trees[myroot]["vartree"] = \
@@ -5151,6 +5152,12 @@ def action_depclean(settings, trees, ldpath_mtimes,
# deep world update would pull in. Don't prune if this atom comes
# directly from world though, since world atoms are greedy when
# they don't specify a slot.
+ visible_in_portdb = [cpv for cpv in pkgs if portdb.match("="+cpv)]
+ if visible_in_portdb:
+ # For consistency with the update algorithm, keep the highest
+ # visible version and prune any versions that are either masked
+ # or no longer exist in the portage tree.
+ pkgs = visible_in_portdb
pkgs = [portage.best(pkgs)]
for pkg in pkgs:
if fakedb.cpv_exists(pkg):