1 |
Author: zmedico |
2 |
Date: 2009-01-21 21:27:20 +0000 (Wed, 21 Jan 2009) |
3 |
New Revision: 12542 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
In depgraph.loadResumeCommand(), account for unsatisfied dependencies of |
9 |
installed packages if they are in the subgraph of dependencies of a package |
10 |
which is scheduled to be installed. |
11 |
|
12 |
|
13 |
Modified: main/trunk/pym/_emerge/__init__.py |
14 |
=================================================================== |
15 |
--- main/trunk/pym/_emerge/__init__.py 2009-01-21 06:36:36 UTC (rev 12541) |
16 |
+++ main/trunk/pym/_emerge/__init__.py 2009-01-21 21:27:20 UTC (rev 12542) |
17 |
@@ -8515,11 +8515,35 @@ |
18 |
if not self._create_graph(allow_unsatisfied=True): |
19 |
return False |
20 |
|
21 |
- # TODO: Add sanity checks to make sure that it's really |
22 |
- # safe to ignore all the deps that can be ignored here. |
23 |
- unsatisfied_deps = [x for x in self._unsatisfied_deps \ |
24 |
- if isinstance(x.parent, Package) and \ |
25 |
- x.parent.operation == "merge"] |
26 |
+ unsatisfied_deps = [] |
27 |
+ for dep in self._unsatisfied_deps: |
28 |
+ if not isinstance(dep.parent, Package): |
29 |
+ continue |
30 |
+ if dep.parent.operation == "merge": |
31 |
+ unsatisfied_deps.append(dep) |
32 |
+ continue |
33 |
+ |
34 |
+ # For unsatisfied deps of installed packages, only account for |
35 |
+ # them if they are in the subgraph of dependencies of a package |
36 |
+ # which is scheduled to be installed. |
37 |
+ unsatisfied_install = False |
38 |
+ traversed = set() |
39 |
+ dep_stack = self.digraph.parent_nodes(dep.parent) |
40 |
+ while dep_stack: |
41 |
+ node = dep_stack.pop() |
42 |
+ if not isinstance(node, Package): |
43 |
+ continue |
44 |
+ if node.operation == "merge": |
45 |
+ unsatisfied_install = True |
46 |
+ break |
47 |
+ if node in traversed: |
48 |
+ continue |
49 |
+ traversed.add(node) |
50 |
+ dep_stack.extend(self.digraph.parent_nodes(node)) |
51 |
+ |
52 |
+ if unsatisfied_install: |
53 |
+ unsatisfied_deps.append(dep) |
54 |
+ |
55 |
if masked_tasks or unsatisfied_deps: |
56 |
# This probably means that a required package |
57 |
# was dropped via --skipfirst. It makes the |