diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-11 03:33:03 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-11 03:33:03 +0000 |
commit | f782e318cfc10b8826f5668f5bab23b3e8f39da7 (patch) | |
tree | 3bdab9691e1e37f6e67255abf40c47d476643edc | |
parent | 5a2ebc46e4f1d0e6bdc0c5f723643db0507227cf (diff) | |
download | portage-f782e318cfc10b8826f5668f5bab23b3e8f39da7.tar.gz portage-f782e318cfc10b8826f5668f5bab23b3e8f39da7.tar.bz2 portage-f782e318cfc10b8826f5668f5bab23b3e8f39da7.zip |
In depgraph._serialize_tasks(), when separating uninstall nodes from leaf
nodes, do it earlier so that it covers more code paths. (trunk r12570)
svn path=/main/branches/2.1.6/; revision=12851
-rw-r--r-- | pym/_emerge/__init__.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 0d83d7cc5..07ef28698 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -6882,21 +6882,26 @@ class depgraph(object): for ignore_priority in ignore_priority_soft_range: nodes = get_nodes(ignore_priority=ignore_priority) if nodes: + # If there is a mix of uninstall nodes with other + # types, save the uninstall nodes for later since + # sometimes a merge node will render an uninstall + # node unnecessary (due to occupying the same slot), + # and we want to avoid executing a separate uninstall + # task in that case. + if len(nodes) > 1: + non_uninstalls = [node for node in nodes \ + if node.operation != "uninstall"] + if non_uninstalls: + nodes = non_uninstalls + else: + nodes = nodes + if ignore_priority is None and not tree_mode: # Greedily pop all of these nodes since no # relationship has been ignored. This optimization # destroys --tree output, so it's disabled in tree - # mode. If there is a mix of merge and uninstall - # nodes, save the uninstall nodes for later since - # sometimes a merge node will render an install - # node unnecessary, and we want to avoid doing a - # separate uninstall task in that case. - merge_nodes = [node for node in nodes \ - if node.operation == "merge"] - if merge_nodes: - selected_nodes = merge_nodes - else: - selected_nodes = nodes + # mode. + selected_nodes = nodes else: # For optimal merge order: # * Only pop one node. |