summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-05-10 08:35:22 +0000
committerZac Medico <zmedico@gentoo.org>2008-05-10 08:35:22 +0000
commit16c494ec54475a4339e93e2c4e4447d5f9f5e029 (patch)
treed5d2220ea020375af9024111c7a612e2883ee01a /pym
parente66428d5cce37d174a1daeed80b9d24afa1e889a (diff)
downloadportage-16c494ec54475a4339e93e2c4e4447d5f9f5e029.tar.gz
portage-16c494ec54475a4339e93e2c4e4447d5f9f5e029.tar.bz2
portage-16c494ec54475a4339e93e2c4e4447d5f9f5e029.zip
When selecting leaf nodes, if there is a mix of merge and uninstall
nodes, save the uninstall nodes from 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. svn path=/main/trunk/; revision=10279
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/__init__.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 15e57047e..a18f5255b 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -3712,8 +3712,18 @@ class depgraph(object):
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 reversed mode.
- selected_nodes = nodes
+ # output, so it's disabled in reversed mode. If there
+ # is a mix of merge and uninstall nodes, save the
+ # uninstall nodes from 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
else:
# For optimal merge order:
# * Only pop one node.