From: Zac Medico Date: Tue, 25 Jul 2006 03:18:26 +0000 (-0000) Subject: Add more dependencies to the digraph in order to help prevent strange merge orders... X-Git-Tag: v2.1.1~142 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c1adb11fbb479d6548668509fee0daa6b751bca6;p=portage.git Add more dependencies to the digraph in order to help prevent strange merge orders for bug #126748. svn path=/main/trunk/; revision=4019 --- diff --git a/bin/emerge b/bin/emerge index 75258b12b..6e4dae692 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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() diff --git a/pym/portage.py b/pym/portage.py index c46aea9f9..96791b377 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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: