From: Zac Medico Date: Wed, 13 Dec 2006 10:40:24 +0000 (-0000) Subject: Track slot atom to digraph node mappings as the depgraph is built. This mapping... X-Git-Tag: v2.1.2~308 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cfea417d0b0e53b7490da2055078e70933853044;p=portage.git 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 --- 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():