Move the self dependency check from digraph.addnode() to depgraph.create() since...
authorZac Medico <zmedico@gentoo.org>
Tue, 25 Jul 2006 04:57:38 +0000 (04:57 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 25 Jul 2006 04:57:38 +0000 (04:57 -0000)
svn path=/main/trunk/; revision=4021

bin/emerge
pym/portage.py

index 6e4dae692251e6ff2d5b6907542f25f09ccc9582..299798e3b5c8f0e2d1b5c5e0db10d719f209f175 100755 (executable)
@@ -691,7 +691,9 @@ class depgraph:
 
                jbigkey = " ".join(mybigkey) + " merge"
                if self.digraph.hasnode(jbigkey):
-                       if addme:
+                       if addme and jbigkey != 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().
                                self.digraph.addnode(jbigkey, myparent)
                        return 1
                jbigkey = " ".join(mybigkey) + " nomerge"
index 96791b3774b91e72afd27f406565062ad9242360..c46aea9f9d2971c7b023e7ced3dff0e1d3cad929 100644 (file)
@@ -318,10 +318,6 @@ class digraph:
                self.okeys=[]
 
        def addnode(self,mykey,myparent):
-               if mykey == myparent:
-                       # Refuse to make a node depend on itself so that the caller doesn't
-                       # accidentally create a bogus circular dependency.
-                       myparent = None
                if not self.dict.has_key(mykey):
                        self.okeys.append(mykey)
                        if myparent is None: