When there are multiple packages occupying the same slot, only consider the one with...
authorZac Medico <zmedico@gentoo.org>
Mon, 11 Dec 2006 09:43:47 +0000 (09:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 11 Dec 2006 09:43:47 +0000 (09:43 -0000)
svn path=/main/trunk/; revision=5268

bin/emerge

index 326c6c57c4e7e229bfce7d2aa7abdb25b3c04396..88e8c60cd3d58279a3d3a5c75ce0483b76ea9466 100755 (executable)
@@ -724,11 +724,24 @@ class FakeVartree(portage.vartree):
                try:
                        if os.access(vdb_path, os.W_OK):
                                vdb_lock = portage_locks.lockdir(vdb_path)
-                       mykeys = ["SLOT", "PROVIDE", "USE", "IUSE",
+                       mykeys = ["SLOT", "COUNTER", "PROVIDE", "USE", "IUSE",
                                "DEPEND", "RDEPEND", "PDEPEND"]
                        real_dbapi = real_vartree.dbapi
+                       slot_counters = {}
                        for cpv in real_dbapi.cpv_all():
                                metadata = dict(izip(mykeys, real_dbapi.aux_get(cpv, mykeys)))
+                               myslot = metadata["SLOT"]
+                               mycp = portage.dep_getkey(cpv)
+                               myslot_atom = "%s:%s" % (myslot, mycp)
+                               try:
+                                       mycounter = long(metadata["COUNTER"])
+                               except ValueError:
+                                       mycounter = 0
+                               other_counter = slot_counters.get(myslot_atom, None)
+                               if other_counter is not None:
+                                       if other_counter > mycounter:
+                                               continue
+                               slot_counters[myslot_atom] = mycounter
                                self.dbapi.cpv_inject(cpv, metadata=metadata)
                finally:
                        if vdb_lock: