summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-13 10:40:24 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-13 10:40:24 +0000
commitcfea417d0b0e53b7490da2055078e70933853044 (patch)
tree2840619f6c59f68ec2a125fd3311956dc27e00dc
parentdbfcaa0658b5cd272071b21631fc15f49ec0d245 (diff)
downloadportage-cfea417d0b0e53b7490da2055078e70933853044.tar.gz
portage-cfea417d0b0e53b7490da2055078e70933853044.tar.bz2
portage-cfea417d0b0e53b7490da2055078e70933853044.zip
Track slot atom to digraph node mappings as the depgraph is built. This mapping will be used to detect node collisions for bug #157897.
svn path=/main/trunk/; revision=5282
-rwxr-xr-xbin/emerge16
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/emerge b/bin/emerge
index 78130487d..5f5482bdd 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -804,6 +804,8 @@ class depgraph:
self.pkgsettings = {}
# Maps cpv to digraph node for "merge" nodes only.
self.pkg_node_map = {}
+ # Maps slot atom to digraph node for all nodes added to the graph.
+ self._slot_node_map = {}
self.mydbapi = {}
self._mydbapi_keys = ["SLOT", "DEPEND", "RDEPEND", "PDEPEND"]
self.useFlags = {}
@@ -818,6 +820,7 @@ class depgraph:
self.pkgsettings[myroot] = portage.config(
clone=self.trees[myroot]["vartree"].settings)
self.pkg_node_map[myroot] = {}
+ self._slot_node_map[myroot] = {}
vardb = self.trees[myroot]["vartree"].dbapi
# This fakedbapi instance will model the state that the vdb will
# have after new packages have been installed.
@@ -968,10 +971,12 @@ class depgraph:
self.digraph.addnode(jbigkey, myparent,
priority=priority)
+ metadata = dict(izip(self._mydbapi_keys,
+ mydbapi.aux_get(mykey, self._mydbapi_keys)))
+ slot_atom = "%s:%s" % (portage.dep_getkey(mykey), metadata["SLOT"])
+ self._slot_node_map[myroot][slot_atom] = jbigkey
if mybigkey[-1] == "merge":
- self.mydbapi[myroot].cpv_inject(mykey,
- metadata=dict(izip(self._mydbapi_keys,
- mydbapi.aux_get(mykey, self._mydbapi_keys))))
+ self.mydbapi[myroot].cpv_inject(mykey, metadata=metadata)
""" This section determines whether we go deeper into dependencies or not.
We want to go deeper on a few occasions:
@@ -1543,11 +1548,10 @@ class depgraph:
myslots = {}
modified_slots[myroot] = myslots
final_db = self.mydbapi[myroot]
- for mycpv, mynode in self.pkg_node_map[myroot].iteritems():
+ slot_node_map = self._slot_node_map[myroot]
+ for slot_atom, mynode in slot_node_map.iteritems():
mytype, myroot, mycpv, mystatus = mynode
if mystatus == "merge":
- slot_atom = "%s:%s" % (portage.dep_getkey(mycpv),
- final_db.aux_get(mycpv, ["SLOT"])[0])
modified_slots[myroot][slot_atom] = mycpv
for blocker in self.blocker_parents.keys():