diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-02-18 20:46:27 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-02-18 20:46:27 +0000 |
commit | da96ba088a8f06046021a243e6cbf3d218434a96 (patch) | |
tree | 2edbef72faa3fe16172a9799183f01eaf40b287c /bin/emerge | |
parent | 6964b400aed4e4a80403adc71b13978832feab95 (diff) | |
download | portage-da96ba088a8f06046021a243e6cbf3d218434a96.tar.gz portage-da96ba088a8f06046021a243e6cbf3d218434a96.tar.bz2 portage-da96ba088a8f06046021a243e6cbf3d218434a96.zip |
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
Diffstat (limited to 'bin/emerge')
-rwxr-xr-x | bin/emerge | 14 |
1 files changed, 12 insertions, 2 deletions
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 |