Combine 2 locations in depgraph.create() where nodes are added to the digraph. This...
authorZac Medico <zmedico@gentoo.org>
Thu, 16 Aug 2007 05:53:51 +0000 (05:53 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 16 Aug 2007 05:53:51 +0000 (05:53 -0000)
svn path=/main/trunk/; revision=7627

pym/emerge/__init__.py

index aa38cfd2739235b41fc395e526d3542f8c6112d1..1e88eb7b08a4a66b97cfdab60f23ff26e96604d3 100644 (file)
@@ -1163,6 +1163,11 @@ class depgraph(object):
                #IUSE-aware emerge -> USE DEP aware depgraph
                #"no downgrade" emerge
                """
+
+               # unused parameters
+               rev_dep = False
+               myuse = None
+
                mytype, myroot, mykey = mybigkey
 
                if mytype == "blocks":
@@ -1209,19 +1214,7 @@ class depgraph(object):
                existing_node = None
                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().
-                               if rev_dep and myparent:
-                                       self.digraph.addnode(myparent, existing_node,
-                                               priority=priority)
-                               else:
-                                       self.digraph.addnode(existing_node, myparent,
-                                               priority=priority)
-                       return 1
-               
+
                if "--nodeps" not in self.myopts:
                        self.spinner.update()
 
@@ -1280,12 +1273,11 @@ class depgraph(object):
                                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,
-                                                       priority=priority)
-                                       else:
+                                       if existing_node != myparent:
+                                               # Refuse to make a node depend on itself so that
+                                               # we don't create a bogus circular dependency
+                                               # in self.altlist().
+                                               self._parent_child_digraph.add(existing_node, myparent)
                                                self.digraph.addnode(existing_node, myparent,
                                                        priority=priority)
                                        return 1
@@ -1362,6 +1354,9 @@ class depgraph(object):
                elif "recurse" not in self.myparams:
                        return 1
 
+               if existing_node:
+                       return 1
+
                """ Check DEPEND/RDEPEND/PDEPEND/SLOT
                Pull from bintree if it's binary package, porttree if it's ebuild.
                Binpkg's can be either remote or local. """