Optimize order for --tree display of circular dependencies. (trunk r6013:6014)
authorZac Medico <zmedico@gentoo.org>
Mon, 19 Feb 2007 07:34:15 +0000 (07:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 19 Feb 2007 07:34:15 +0000 (07:34 -0000)
svn path=/main/branches/2.1.2/; revision=6015

bin/emerge

index c5d34aa8d1dbab5842701c35d924324179edd682..20eb7265f240a4eafa7e7a161d34b447115ae7bd 100755 (executable)
@@ -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()