diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-11-02 01:14:18 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-11-02 01:14:18 +0000 |
commit | 172d6fd99afb04320e77800363993feae04ddfe7 (patch) | |
tree | 36602798290d598126a5c2d637ce3505ffd71e0e | |
parent | 260790707b2414e81c4173d80326fd270cdb4e05 (diff) | |
download | portage-172d6fd99afb04320e77800363993feae04ddfe7.tar.gz portage-172d6fd99afb04320e77800363993feae04ddfe7.tar.bz2 portage-172d6fd99afb04320e77800363993feae04ddfe7.zip |
Optimize merge order to try and select nodes that only have
unsatisfied PDEPEND slightly earlier. This solves a problem
with xorg-server being merged too early during an all binary
install (since DEPEND is ignored for binaries), triggering
built_with_use() calls to fail as reported in bug #189966.
Since DEPEND is discarded in cases like this, it is
important to exploit the difference between PDEPEND and
RDEPEND in order to optimize merge order. Without this
optimization, the merge order is technically correct, but
not as optimal as it should be and has lots of potential to
trigger issues with built_with_use() or similar things that
require better optimization of merge order.
svn path=/main/trunk/; revision=8358
-rw-r--r-- | pym/_emerge/__init__.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 15771e154..6d3e69215 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2700,7 +2700,7 @@ class depgraph(object): break ignore_priority_soft_range = [None] ignore_priority_soft_range.extend( - xrange(DepPriority.MIN, DepPriority.SOFT + 1)) + xrange(DepPriority.MIN, DepPriority.MEDIUM_SOFT + 1)) tree_mode = "--tree" in self.myopts # Tracks whether or not the current iteration should prefer asap_nodes # if available. This is set to False when the previous iteration @@ -2765,6 +2765,25 @@ class depgraph(object): (accept_root_node or ignore_priority is None): # 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: |