summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-23 00:30:55 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-23 00:30:55 +0000
commit4936d1855919422edd84ce7f90c6c763c6871ec2 (patch)
treeecbfc8acb3993e14521b25a41c8a02dfc5766b90
parent664bfd8da7a215d23c6209a944a4c1a27da75cf2 (diff)
downloadportage-4936d1855919422edd84ce7f90c6c763c6871ec2.tar.gz
portage-4936d1855919422edd84ce7f90c6c763c6871ec2.tar.bz2
portage-4936d1855919422edd84ce7f90c6c763c6871ec2.zip
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 <welp@g.o> for reporting. svn path=/main/trunk/; revision=12045
-rw-r--r--pym/_emerge/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index fe810ab78..1dd0575d8 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -5404,13 +5404,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))))