Add more dependencies to the digraph in order to help prevent strange merge orders...
authorZac Medico <zmedico@gentoo.org>
Tue, 25 Jul 2006 03:18:26 +0000 (03:18 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 25 Jul 2006 03:18:26 +0000 (03:18 -0000)
svn path=/main/trunk/; revision=4019

bin/emerge
pym/portage.py

index 75258b12b3ae797e04354be738a91f3ef27079c7..6e4dae692251e6ff2d5b6907542f25f09ccc9582 100755 (executable)
@@ -689,9 +689,13 @@ class depgraph:
                #"no downgrade" emerge
                """
 
-               jbigkey=string.join(mybigkey)
-               # Prevent cycles where packages are already in the digraph
-               if self.digraph.hasnode(jbigkey+" merge") or self.digraph.hasnode(jbigkey+" nomerge"):
+               jbigkey = " ".join(mybigkey) + " merge"
+               if self.digraph.hasnode(jbigkey):
+                       if addme:
+                               self.digraph.addnode(jbigkey, myparent)
+                       return 1
+               jbigkey = " ".join(mybigkey) + " nomerge"
+               if self.digraph.hasnode(jbigkey):
                        return 1
                
                self.spinner.update()
index c46aea9f9d2971c7b023e7ced3dff0e1d3cad929..96791b3774b91e72afd27f406565062ad9242360 100644 (file)
@@ -318,6 +318,10 @@ 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: