From: Zac Medico Date: Sun, 23 Nov 2008 00:33:59 +0000 (-0000) Subject: When displaying anscestors of an unstatisfied dependency (code from bug X-Git-Tag: v2.1.6_rc1~18 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f629df2a2efdf22eb3b0e569fd13a173e2583746;p=portage.git When displaying anscestors of an unstatisfied dependency (code from bug #245358), avoid a potential infinite loop and memory leak triggered by circular dependencies. Thanks to Peter Weller for reporting. (trunk r12045) svn path=/main/branches/2.1.6/; revision=12046 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index e8bcd7cd0..c69998e67 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -5388,13 +5388,18 @@ class depgraph(object): print "\nemerge: there are no ebuilds to satisfy "+green(xinfo)+"." # Show parent nodes and the argument that pulled them in. + traversed_nodes = set() node = myparent msg = [] while node is not None: + traversed_nodes.add(node) msg.append('(dependency required by "%s" [%s])' % \ (colorize('INFORM', str(node.cpv)), node.type_name)) parent = None for parent in self.digraph.parent_nodes(node): + if parent in traversed_nodes: + parent = None + continue if isinstance(parent, DependencyArg): msg.append('(dependency required by "%s" [argument])' % \ (colorize('INFORM', str(parent))))