summaryrefslogtreecommitdiffstats
path: root/pym/emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-09-23 23:56:28 +0000
committerZac Medico <zmedico@gentoo.org>2007-09-23 23:56:28 +0000
commitb2f8469ba3da7ecc5e9198b9ec8c826c9a0abf24 (patch)
tree87ba74a445393d2e7d86c89424c1e58bc60ce278 /pym/emerge
parent417386003fa43fb02d49b2c09e5012bfb8114568 (diff)
downloadportage-b2f8469ba3da7ecc5e9198b9ec8c826c9a0abf24.tar.gz
portage-b2f8469ba3da7ecc5e9198b9ec8c826c9a0abf24.tar.bz2
portage-b2f8469ba3da7ecc5e9198b9ec8c826c9a0abf24.zip
When --deep is not enabled, many dependencies are dicarded and
left out of the digraph. This patch prevents dependencies from being discarded in some cases where the are needed in order to optimize merge order. It also modifies the DepPriority.rebuild attribute so that it only applies to build time dependencies. This leads to better merge order in some cases when --deep is not enabled. For example, `emerge xf86-input-keyboard xorg-server` will now properly merge xorg-server before xf86-input-keyboard (problem from bug #192254, comment #5). svn path=/main/trunk/; revision=7797
Diffstat (limited to 'pym/emerge')
-rw-r--r--pym/emerge/__init__.py38
1 files changed, 25 insertions, 13 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index 652a3d355..6e0dc1d30 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -715,9 +715,9 @@ class DepPriority(object):
return -1
if self.runtime_post:
return -2
- if self.rebuild:
- return -3
if self.buildtime:
+ if self.rebuild:
+ return -3
return -4
if self.runtime:
return -5
@@ -1735,17 +1735,6 @@ class depgraph(object):
("blocks", p_root, x[1:]), set()).add(myparent)
continue
else:
- #We are not processing a blocker but a normal dependency
- if myparent:
- """In some cases, dep_check will return deps that shouldn't
- be proccessed any further, so they are identified and
- discarded here."""
- if "empty" not in self.myparams and \
- "deep" not in self.myparams and \
- not ("--update" in self.myopts and parent_arg) and \
- vardb.match(x):
- continue
-
# List of acceptable packages, ordered by type preference.
matched_packages = []
myeb_matches = portdb.xmatch("match-visible", x)
@@ -1965,6 +1954,29 @@ class depgraph(object):
# ordered by type preference ("ebuild" type is the last resort)
selected_pkg = matched_packages[0]
+ # In some cases, dep_check will return deps that shouldn't
+ # be proccessed any further, so they are identified and
+ # discarded here. Try to discard as few as possible since
+ # discarded dependencies reduce the amount of information
+ # available for optimization of merge order.
+ if myparent and not arg and vardb.match(x) and \
+ not existing_node and \
+ "empty" not in self.myparams and \
+ "deep" not in self.myparams and \
+ not ("--update" in self.myopts and parent_arg):
+ (mytype, myroot, mykey), metadata = selected_pkg
+ myarg = None
+ if myroot == self.target_root:
+ try:
+ myarg = self._set_atoms.findAtomForPackage(
+ mykey, metadata)
+ except portage.exception.InvalidDependString:
+ # This is already handled inside
+ # self.create() when necessary.
+ pass
+ if not myarg:
+ continue
+
if myparent:
#we are a dependency, so we want to be unconditionally added
mypriority = priority.copy()