Fix --prune so that it always correctly accounts for COUNTER when dealing with packag...
authorZac Medico <zmedico@gentoo.org>
Fri, 20 Jul 2007 02:00:02 +0000 (02:00 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 20 Jul 2007 02:00:02 +0000 (02:00 -0000)
svn path=/main/trunk/; revision=7313

pym/emerge/__init__.py

index 5c3ad335a03366c5fd81fac91d2420820a2b44f2..88637ee2f20dbc2a65e5a61fcaf4f8ec3a498e22 100644 (file)
@@ -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