Use depgraph.pkg_node_map so simplify comparison against existing nodes at the beginn...
authorZac Medico <zmedico@gentoo.org>
Thu, 14 Dec 2006 01:57:22 +0000 (01:57 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 14 Dec 2006 01:57:22 +0000 (01:57 -0000)
svn path=/main/trunk/; revision=5290

bin/emerge

index 9450e6a55d353325e8864e73f57cf927b5014a54..178168ebfa38b43e80e597760574c7cd4cffe08f 100755 (executable)
@@ -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()