From: Zac Medico Date: Mon, 19 Feb 2007 07:33:24 +0000 (-0000) Subject: Optimize order for --tree display of circular dependencies. X-Git-Tag: v2.2_pre1~1675 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ec2b3443f9707eee8217aad2cd730a65d6b1036d;p=portage.git Optimize order for --tree display of circular dependencies. svn path=/main/trunk/; revision=6014 --- diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 5567bb3e0..50e91d64c 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -2101,10 +2101,21 @@ class depgraph: # Display the USE flags that are enabled on nodes that are part # of dependency cycles in case that helps the user decide to # disable some of them. + display_order = [] + tempgraph = mygraph.copy() + while not tempgraph.empty(): + nodes = tempgraph.leaf_nodes() + if not nodes: + node = tempgraph.order[0] + else: + node = nodes[0] + display_order.append(list(node)) + tempgraph.remove(node) + display_order.reverse() self.myopts.pop("--quiet", None) self.myopts.pop("--verbose", None) self.myopts["--tree"] = True - self.display([list(node) for node in mygraph.order]) + self.display(display_order) print "!!! Error: circular dependencies:" print mygraph.debug_print()