From 4f76ae3cca192319d3578ed5c0c01bff92eacb2a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 11 Dec 2006 09:43:47 +0000 Subject: [PATCH] When there are multiple packages occupying the same slot, only consider the one with the highest COUNTER. Thanks to leio for reporting. svn path=/main/trunk/; revision=5268 --- bin/emerge | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/emerge b/bin/emerge index 326c6c57c..88e8c60cd 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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: -- 2.26.2