summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-08 02:49:53 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-08 02:49:53 +0000
commit70b86e2116cfe6747d7eac2bba2f201d043039fa (patch)
treeedf505dd4e85081942ad0faca029b3cae8efb211
parent9c01486fafb781204c52577fb8a61e5210b4706c (diff)
downloadportage-70b86e2116cfe6747d7eac2bba2f201d043039fa.tar.gz
portage-70b86e2116cfe6747d7eac2bba2f201d043039fa.tar.bz2
portage-70b86e2116cfe6747d7eac2bba2f201d043039fa.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.
svn path=/main/trunk/; revision=7195
-rw-r--r--pym/emerge/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index 96026cc1c..9eaacec1f 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -5247,6 +5247,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"] = \
@@ -5301,6 +5302,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):