From: Zac Medico Date: Thu, 14 Dec 2006 01:57:22 +0000 (-0000) Subject: Use depgraph.pkg_node_map so simplify comparison against existing nodes at the beginn... X-Git-Tag: v2.1.2~301 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f8aa168d03f1f3535150765a6d37dfec0a836518;p=portage.git Use depgraph.pkg_node_map so simplify comparison against existing nodes at the beginning of depgraph.create(). svn path=/main/trunk/; revision=5290 --- diff --git a/bin/emerge b/bin/emerge index 9450e6a55..178168ebf 100755 --- a/bin/emerge +++ b/bin/emerge @@ -901,25 +901,18 @@ class depgraph: #IUSE-aware emerge -> USE DEP aware depgraph #"no downgrade" emerge """ - jbigkey = tuple(chain(mybigkey, ["merge"])) mytype, myroot, mykey = mybigkey - if self.digraph.hasnode(jbigkey): - if addme and jbigkey != myparent: + existing_node = self.pkg_node_map[myroot].get(mykey, None) + if existing_node: + if addme and 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(). if rev_dep and myparent: - ptype, proot, pkey, pstatus = myparent - self.digraph.addnode(myparent, jbigkey, priority=priority) + self.digraph.addnode(myparent, existing_node, + priority=priority) else: - self.digraph.addnode(jbigkey, myparent, priority=priority) - return 1 - jbigkey = tuple(chain(mybigkey, ["nomerge"])) - if self.digraph.hasnode(jbigkey): - if rev_dep and myparent: - ptype, proot, pkey, pstatus = myparent - self.digraph.addnode(myparent, jbigkey, priority=priority) - else: - self.digraph.addnode(jbigkey, myparent, priority=priority) + self.digraph.addnode(existing_node, myparent, + priority=priority) return 1 self.spinner.update()