1 |
Author: zmedico |
2 |
Date: 2008-04-13 22:19:47 +0000 (Sun, 13 Apr 2008) |
3 |
New Revision: 9877 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/bin/emerge |
7 |
Log: |
8 |
Improve lookahead for new-style virtuals: |
9 |
|
10 |
* Substitute the graph tree for the vartree in dep_check() since we |
11 |
want atom selections to be consistent with package selections |
12 |
that have already been made. |
13 |
* Add the selected package to the graph as soon as possible |
14 |
so that later dep_check() calls can use it as feedback |
15 |
for making more consistent atom selections. |
16 |
* Expand all slots of new-style virtuals inside _dep_check_composite_db |
17 |
so that lookahead examines all matched slots. |
18 |
|
19 |
This solves some cases of bug #1343, and extends the fix for bug |
20 |
#141118 to work in cases when a virtual is not yet installed but |
21 |
it has been pulled into the graph. |
22 |
|
23 |
(trunk r9873) |
24 |
|
25 |
|
26 |
Modified: main/branches/2.1.2/bin/emerge |
27 |
=================================================================== |
28 |
--- main/branches/2.1.2/bin/emerge 2008-04-13 22:13:59 UTC (rev 9876) |
29 |
+++ main/branches/2.1.2/bin/emerge 2008-04-13 22:19:47 UTC (rev 9877) |
30 |
@@ -1742,7 +1742,11 @@ |
31 |
self._graph_trees[myroot]["vartree"] = self.trees[myroot]["vartree"] |
32 |
del vardb, fakedb |
33 |
self._filtered_trees[myroot] = {} |
34 |
- self._filtered_trees[myroot]["vartree"] = self.trees[myroot]["vartree"] |
35 |
+ # Substitute the graph tree for the vartree in dep_check() since we |
36 |
+ # want atom selections to be consistent with package selections |
37 |
+ # have already been made. |
38 |
+ self._filtered_trees[myroot]["vartree"] = \ |
39 |
+ self._graph_trees[myroot]["porttree"] |
40 |
def filtered_tree(): |
41 |
pass |
42 |
filtered_tree.dbapi = self._dep_check_composite_db(self, myroot) |
43 |
@@ -2579,8 +2583,17 @@ |
44 |
arg.name in ("system", "world")): |
45 |
return 0, myfavorites |
46 |
|
47 |
- self._dep_stack.append( |
48 |
- Dependency(atom=atom, onlydeps=onlydeps, root=myroot, parent=arg)) |
49 |
+ dep = Dependency(atom=atom, onlydeps=onlydeps, |
50 |
+ root=myroot, parent=arg) |
51 |
+ self._dep_stack.append(dep) |
52 |
+ |
53 |
+ # Add the selected package to the graph as soon as possible |
54 |
+ # so that later dep_check() calls can use it as feedback |
55 |
+ # for making more consistent atom selections. |
56 |
+ if not self._add_pkg(pkg, dep.parent, |
57 |
+ priority=dep.priority, depth=dep.depth): |
58 |
+ return 0, myfavorites |
59 |
+ |
60 |
if not self._create_graph(): |
61 |
if isinstance(arg, SetArg): |
62 |
sys.stderr.write(("\n\n!!! Problem resolving " + \ |
63 |
@@ -4513,12 +4526,20 @@ |
64 |
slots = set() |
65 |
slots.add(pkg.metadata["SLOT"]) |
66 |
atom_cp = portage.dep_getkey(atom) |
67 |
- if atom_cp == pkg.cp: |
68 |
- graph_db = self._depgraph.mydbapi[self._root] |
69 |
- for cpv in graph_db.match(atom): |
70 |
- if portage.cpv_getkey(cpv) != pkg.cp: |
71 |
- continue |
72 |
- slots.add(graph_db.aux_get(cpv, ["SLOT"])[0]) |
73 |
+ if pkg.cp.startswith("virtual/"): |
74 |
+ # For new-style virtual lookahead that occurs inside |
75 |
+ # dep_check(), examine all slots. This is needed |
76 |
+ # so that newer slots will not unnecessarily be pulled in |
77 |
+ # when a satisfying lower slot is already installed. For |
78 |
+ # example, if virtual/jdk-1.4 is satisfied via kaffe then |
79 |
+ # there's no need to pull in a newer slot to satisfy a |
80 |
+ # virtual/jdk dependency. |
81 |
+ for db, pkg_type, built, installed, db_keys in \ |
82 |
+ self._depgraph._filtered_trees[self._root]["dbs"]: |
83 |
+ for cpv in db.match(atom): |
84 |
+ if portage.cpv_getkey(cpv) != pkg.cp: |
85 |
+ continue |
86 |
+ slots.add(db.aux_get(cpv, ["SLOT"])[0]) |
87 |
ret = [] |
88 |
if self._visible(pkg): |
89 |
self._cpv_pkg_map[pkg.cpv] = pkg |
90 |
|
91 |
-- |
92 |
gentoo-commits@l.g.o mailing list |