From: Zac Medico Date: Mon, 19 Feb 2007 07:34:15 +0000 (-0000) Subject: Optimize order for --tree display of circular dependencies. (trunk r6013:6014) X-Git-Tag: v2.1.2.1~55 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dce252e58f4bad4c7be7d0366adb06d6ba45c20b;p=portage.git Optimize order for --tree display of circular dependencies. (trunk r6013:6014) svn path=/main/branches/2.1.2/; revision=6015 --- diff --git a/bin/emerge b/bin/emerge index c5d34aa8d..20eb7265f 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2097,10 +2097,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()