Never traverse the same node twice when showing parents in
authorZac Medico <zmedico@gentoo.org>
Sat, 18 Sep 2010 07:58:29 +0000 (00:58 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 18 Sep 2010 07:58:29 +0000 (00:58 -0700)
depgraph._show_unsatisfied_dep().

pym/_emerge/depgraph.py

index a2f3e091e72823a275ec7806500c2e765179e671..3c8d41eb4d1ea6a04ba4d62d0f92b44649fa8fc2 100644 (file)
@@ -2387,6 +2387,8 @@ class depgraph(object):
                        # package twice, in order to prevent an infinite loop.
                        selected_parent = None
                        for parent in self._dynamic_config.digraph.parent_nodes(node):
+                               if parent in traversed_nodes:
+                                       continue
                                if isinstance(parent, DependencyArg):
                                        if self._dynamic_config.digraph.parent_nodes(parent):
                                                selected_parent = parent
@@ -2395,7 +2397,7 @@ class depgraph(object):
                                                        colorize('INFORM', _unicode_decode("%s") % (parent,)))
                                                selected_parent = None
                                        break
-                               if parent not in traversed_nodes:
+                               else:
                                        selected_parent = parent
                        node = selected_parent
                writemsg_stdout("\n".join(msg), noiselevel=-1)