summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-11 03:19:54 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-11 03:19:54 +0000
commitce06d043f12798f3f85b6c8647d1de31c37ee431 (patch)
tree1aa1ab471669a099c8f224c17c8429a9a4a12828 /pym
parent9e7bf33c3e1513787a2470f020e4600c5afb8b14 (diff)
downloadportage-ce06d043f12798f3f85b6c8647d1de31c37ee431.tar.gz
portage-ce06d043f12798f3f85b6c8647d1de31c37ee431.tar.bz2
portage-ce06d043f12798f3f85b6c8647d1de31c37ee431.zip
In depgraph.loadResumeCommand(), account for unsatisfied dependencies of
installed packages if they are in the subgraph of dependencies of a package which is scheduled to be installed. (trunk r12542) svn path=/main/branches/2.1.6/; revision=12828
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/__init__.py34
1 files changed, 29 insertions, 5 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index bf070dd91..b52dba05d 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -8499,11 +8499,35 @@ class depgraph(object):
if not self._create_graph(allow_unsatisfied=True):
return False
- # TODO: Add sanity checks to make sure that it's really
- # safe to ignore all the deps that can be ignored here.
- unsatisfied_deps = [x for x in self._unsatisfied_deps \
- if isinstance(x.parent, Package) and \
- x.parent.operation == "merge"]
+ unsatisfied_deps = []
+ for dep in self._unsatisfied_deps:
+ if not isinstance(dep.parent, Package):
+ continue
+ if dep.parent.operation == "merge":
+ unsatisfied_deps.append(dep)
+ continue
+
+ # For unsatisfied deps of installed packages, only account for
+ # them if they are in the subgraph of dependencies of a package
+ # which is scheduled to be installed.
+ unsatisfied_install = False
+ traversed = set()
+ dep_stack = self.digraph.parent_nodes(dep.parent)
+ while dep_stack:
+ node = dep_stack.pop()
+ if not isinstance(node, Package):
+ continue
+ if node.operation == "merge":
+ unsatisfied_install = True
+ break
+ if node in traversed:
+ continue
+ traversed.add(node)
+ dep_stack.extend(self.digraph.parent_nodes(node))
+
+ if unsatisfied_install:
+ unsatisfied_deps.append(dep)
+
if masked_tasks or unsatisfied_deps:
# This probably means that a required package
# was dropped via --skipfirst. It makes the