diff options
-rw-r--r-- | pym/_emerge/__init__.py | 55 |
1 files changed, 18 insertions, 37 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 6d3e69215..d47739438 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2729,6 +2729,7 @@ class depgraph(object): while not mygraph.empty(): selected_nodes = None + ignore_priority = None if prefer_asap and asap_nodes: """ASAP nodes are merged before their soft deps.""" asap_nodes = [node for node in asap_nodes \ @@ -2766,24 +2767,6 @@ class depgraph(object): # settle for a root node selected_nodes = [nodes[0]] - if selected_nodes and ignore_priority > DepPriority.SOFT: - # Try to merge ignored medium deps as soon as possible. - for node in selected_nodes: - children = set(mygraph.child_nodes(node)) - soft = children.difference( - mygraph.child_nodes(node, - ignore_priority=DepPriority.SOFT)) - medium_soft = children.difference( - mygraph.child_nodes(node, - ignore_priority=DepPriority.MEDIUM_SOFT)) - medium_soft.difference_update(soft) - for child in medium_soft: - if child in selected_nodes: - continue - if child in asap_nodes: - continue - asap_nodes.append(child) - if not selected_nodes: nodes = get_nodes(ignore_priority=DepPriority.MEDIUM) if nodes: @@ -2839,25 +2822,23 @@ class depgraph(object): accept_root_node = True continue - if selected_nodes and ignore_priority > DepPriority.SOFT: - # Try to merge ignored medium deps as soon as possible. - for node in selected_nodes: - children = set(mygraph.child_nodes(node)) - soft = children.difference( - mygraph.child_nodes(node, - ignore_priority=DepPriority.SOFT)) - medium_soft = children.difference( - mygraph.child_nodes(node, - ignore_priority=DepPriority.MEDIUM_SOFT)) - medium_soft.difference_update(soft) - for child in medium_soft: - if child in selected_nodes: - continue - if child in asap_nodes: - continue - # TODO: Try harder to make these nodes get - # merged absolutely as soon as possible. - asap_nodes.append(child) + if selected_nodes and ignore_priority > DepPriority.SOFT: + # Try to merge ignored medium deps as soon as possible. + for node in selected_nodes: + children = set(mygraph.child_nodes(node)) + soft = children.difference( + mygraph.child_nodes(node, + ignore_priority=DepPriority.SOFT)) + medium_soft = children.difference( + mygraph.child_nodes(node, + ignore_priority=DepPriority.MEDIUM_SOFT)) + medium_soft.difference_update(soft) + for child in medium_soft: + if child in selected_nodes: + continue + if child in asap_nodes: + continue + asap_nodes.append(child) if not selected_nodes: if not myblockers.is_empty(): |