From: Zac Medico Date: Sun, 18 Feb 2007 20:46:27 +0000 (-0000) Subject: For bug #167450, optimize merge order by delaying the merge of root nodes. (trunk... X-Git-Tag: v2.1.2.1~64 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=da96ba088a8f06046021a243e6cbf3d218434a96;p=portage.git For bug #167450, optimize merge order by delaying the merge of root nodes. (trunk r5995:5996) svn path=/main/branches/2.1.2/; revision=5997 --- diff --git a/bin/emerge b/bin/emerge index 593528542..8f4f25712 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2021,8 +2021,18 @@ class depgraph: # output, so it's disabled in reversed mode. selected_nodes = nodes else: - # Only pop one node for optimal merge order. - selected_nodes = [nodes[0]] + # For optimal merge order: + # * Only pop one node. + # * Removing a root node (node without a parent) + # will not produce a leaf node, so avoid it. + for node in nodes: + if mygraph.parent_nodes(node): + # found a non-root node + selected_nodes = [node] + break + if not selected_nodes: + # settle for a root node + selected_nodes = [nodes[0]] else: """Recursively gather a group of nodes that RDEPEND on eachother. This ensures that they are merged as a group