summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-20 02:00:02 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-20 02:00:02 +0000
commit70ab8ba6a2c4218071862ff1f394d79711252331 (patch)
treeca039c6378ab9bf281dc5fa5b87df1ecab5a1be0
parent5323a2b5a846b8854ebca37f160559b5b0b7499d (diff)
downloadportage-70ab8ba6a2c4218071862ff1f394d79711252331.tar.gz
portage-70ab8ba6a2c4218071862ff1f394d79711252331.tar.bz2
portage-70ab8ba6a2c4218071862ff1f394d79711252331.zip
Fix --prune so that it always correctly accounts for COUNTER when dealing with packages in the same slot.
svn path=/main/trunk/; revision=7313
-rw-r--r--pym/emerge/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index 5c3ad335a..88637ee2f 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -4029,9 +4029,10 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files,
best_slot = vartree.getslot(best_version)
best_counter = vartree.dbapi.cpv_counter(best_version)
for mypkg in mymatch[1:]:
- if mypkg == portage.best([mypkg, best_version]):
- myslot = vartree.getslot(mypkg)
- mycounter = vartree.dbapi.cpv_counter(mypkg)
+ myslot = vartree.getslot(mypkg)
+ mycounter = vartree.dbapi.cpv_counter(mypkg)
+ if (myslot == best_slot and mycounter > best_counter) or \
+ mypkg == portage.best([mypkg, best_version]):
if myslot == best_slot:
if mycounter < best_counter:
# On slot collision, keep the one with the