diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-12-19 08:12:57 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-12-19 08:12:57 +0000 |
commit | 3a08a783d9f3e7b55a4847db1b4df6cad95f4f20 (patch) | |
tree | 8213faede8e1e228de44dbe9321e5adafa11656b | |
parent | 66c4d613b4c2e9d51026dfb7688729abc5763897 (diff) | |
download | portage-3a08a783d9f3e7b55a4847db1b4df6cad95f4f20.tar.gz portage-3a08a783d9f3e7b55a4847db1b4df6cad95f4f20.tar.bz2 portage-3a08a783d9f3e7b55a4847db1b4df6cad95f4f20.zip |
Use a separate digraph to store parent/child relationships (PDEPEND relationships are not reversed) so that relationship is always known in case a slot collision occurs.
svn path=/main/trunk/; revision=5324
-rwxr-xr-x | bin/emerge | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/bin/emerge b/bin/emerge index 7ca854804..c997937d6 100755 --- a/bin/emerge +++ b/bin/emerge @@ -840,6 +840,9 @@ class depgraph: self.missingbins=[] self.digraph=portage.digraph() + # Tracks simple parent/child relationships (PDEPEND relationships are + # not reversed). + self._parent_child_digraph = digraph() self.orderedkeys=[] self.outdatedpackages=[] self.args_keys = [] @@ -912,6 +915,7 @@ class depgraph: if addme: existing_node = self.pkg_node_map[myroot].get(mykey) if existing_node: + self._parent_child_digraph.add(existing_node, myparent) if existing_node != myparent: # Refuse to make a node depend on itself so that the we don't # don't create a bogus circular dependency in self.altlist(). @@ -984,6 +988,7 @@ class depgraph: mybigkey.append("merge") else: mybigkey.append("nomerge") + jbigkey = tuple(mybigkey) if addme: metadata = dict(izip(self._mydbapi_keys, @@ -999,6 +1004,7 @@ class depgraph: e_type, myroot, e_cpv, e_status = existing_node if mykey == e_cpv: # The existing node can be reused. + self._parent_child_digraph.add(existing_node, myparent) if rev_dep and myparent: ptype, proot, pkey, pstatus = myparent self.digraph.addnode(myparent, existing_node, @@ -1008,16 +1014,16 @@ class depgraph: priority=priority) return 1 else: - e_parents = self.digraph.parent_nodes(existing_node) + e_parents = self._parent_child_digraph.parent_nodes( + existing_node) myparents = [] if myparent: myparents.append(myparent) self._show_slot_collision_notice( - ((tuple(mybigkey), myparents), + ((jbigkey, myparents), (existing_node, e_parents))) return 0 - jbigkey = tuple(mybigkey) self._slot_node_map[myroot][slot_atom] = jbigkey self.pkg_node_map[myroot][mykey] = jbigkey self.useFlags[myroot][mykey] = myuse @@ -1030,6 +1036,11 @@ class depgraph: self.digraph.addnode(jbigkey, myparent, priority=priority) + # Do this even when addme is False (--onlydeps) so that the + # parent/child relationship is always known in case + # self._show_slot_collision_notice() needs to be called later. + self._parent_child_digraph.add(jbigkey, myparent) + """ This section determines whether we go deeper into dependencies or not. We want to go deeper on a few occasions: Installing package A, we need to make sure package A's deps are met. |