summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-11 09:43:47 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-11 09:43:47 +0000
commit4f76ae3cca192319d3578ed5c0c01bff92eacb2a (patch)
tree9c04971e61c8e0c50abeff2a7e1966e96a9124d9
parentdff59172ed7a5f86302e873d1611961966aa35c3 (diff)
downloadportage-4f76ae3cca192319d3578ed5c0c01bff92eacb2a.tar.gz
portage-4f76ae3cca192319d3578ed5c0c01bff92eacb2a.tar.bz2
portage-4f76ae3cca192319d3578ed5c0c01bff92eacb2a.zip
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
-rwxr-xr-xbin/emerge15
1 files changed, 14 insertions, 1 deletions
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: