summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-02 03:39:20 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-02 03:39:20 +0000
commitc1f7b0d92443b591ce15d17316b65141aee3f4f6 (patch)
tree19b1ef2688ae2524e39271b4a39fe28ad9fbef6b
parentf2236468dded57d152a5cfb5b799fbac9c9a9e55 (diff)
downloadportage-c1f7b0d92443b591ce15d17316b65141aee3f4f6.tar.gz
portage-c1f7b0d92443b591ce15d17316b65141aee3f4f6.tar.bz2
portage-c1f7b0d92443b591ce15d17316b65141aee3f4f6.zip
Clean up the selected_nodes logic in depgraph.altlist().
svn path=/main/trunk/; revision=7122
-rw-r--r--pym/emerge/__init__.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index ac6a2d456..4e1b7337b 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -2094,13 +2094,12 @@ class depgraph(object):
if "portage" == portage.catsplit(portage.dep_getkey(cpv))[-1]:
asap_nodes.append(node)
break
- ignore_priority_range = [None]
- ignore_priority_range.extend(
+ ignore_priority_soft_range = [None]
+ ignore_priority_soft_range.extend(
xrange(DepPriority.MIN, DepPriority.SOFT + 1))
tree_mode = "--tree" in self.myopts
while not mygraph.empty():
- ignore_priority = None
- nodes = None
+ selected_nodes = None
if asap_nodes:
"""ASAP nodes are merged before their soft deps."""
for node in asap_nodes:
@@ -2109,17 +2108,15 @@ class depgraph(object):
continue
if not mygraph.child_nodes(node,
ignore_priority=DepPriority.SOFT):
- nodes = [node]
+ selected_nodes = [node]
asap_nodes.remove(node)
break
- if not nodes:
- for ignore_priority in ignore_priority_range:
+ if not selected_nodes:
+ for ignore_priority in ignore_priority_soft_range:
nodes = get_nodes(ignore_priority=ignore_priority)
if nodes:
break
- selected_nodes = None
- if nodes:
- if ignore_priority <= DepPriority.SOFT:
+ if 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
@@ -2138,7 +2135,7 @@ class depgraph(object):
if not selected_nodes:
# settle for a root node
selected_nodes = [nodes[0]]
- if not nodes:
+ if not selected_nodes:
nodes = get_nodes(ignore_priority=DepPriority.MEDIUM)
if nodes:
"""Recursively gather a group of nodes that RDEPEND on