summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-30 05:48:28 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-30 05:48:28 +0000
commit8cf31332aeb028d7ef5d4f25745551aabe87ef36 (patch)
tree28661a27fdfe6cc78d973403e631345569bd4398 /bin
parent9a8acc485feac80fc25f30671ebd803477e3a731 (diff)
downloadportage-8cf31332aeb028d7ef5d4f25745551aabe87ef36.tar.gz
portage-8cf31332aeb028d7ef5d4f25745551aabe87ef36.tar.bz2
portage-8cf31332aeb028d7ef5d4f25745551aabe87ef36.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. (branches/2.1.2 r7196)
svn path=/main/branches/2.1.2.9/; revision=7491
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge
index 15145183c..02ee3ea25 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -4742,6 +4742,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"] = \
@@ -4794,6 +4795,12 @@ def action_depclean(settings, trees, ldpath_mtimes,
# deep world update would pull in. Don't prune if the cpv is in
# system or world though, since those sets trigger greedy update
# of all slots.
+ 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):