1 |
Author: zmedico |
2 |
Date: 2008-06-27 23:42:29 +0000 (Fri, 27 Jun 2008) |
3 |
New Revision: 10823 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
Fix depgraph.break_refs() to work with DependencyArg instances (or anything |
9 |
else that may have a "root_config" attribute). |
10 |
|
11 |
|
12 |
Modified: main/trunk/pym/_emerge/__init__.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/_emerge/__init__.py 2008-06-27 23:34:55 UTC (rev 10822) |
15 |
+++ main/trunk/pym/_emerge/__init__.py 2008-06-27 23:42:29 UTC (rev 10823) |
16 |
@@ -3862,26 +3862,24 @@ |
17 |
retlist.reverse() |
18 |
return retlist |
19 |
|
20 |
- def break_refs(self, mergelist): |
21 |
+ def break_refs(self, nodes): |
22 |
""" |
23 |
Take a mergelist like that returned from self.altlist() and |
24 |
break any references that lead back to the depgraph. This is |
25 |
useful if you want to hold references to packages without |
26 |
also holding the depgraph on the heap. |
27 |
""" |
28 |
- for node in mergelist: |
29 |
- if not isinstance(node, Package): |
30 |
- continue |
31 |
+ for node in nodes: |
32 |
+ if hasattr(node, "root_config"): |
33 |
+ # The FakeVartree references the _package_cache which |
34 |
+ # references the depgraph. So that Package instances don't |
35 |
+ # hold the depgraph and FakeVartree on the heap, replace |
36 |
+ # the RootConfig that references the FakeVartree with the |
37 |
+ # original RootConfig instance which references the actual |
38 |
+ # vartree. |
39 |
+ node.root_config = \ |
40 |
+ self._trees_orig[node.root_config.root]["root_config"] |
41 |
|
42 |
- # The FakeVartree references the _package_cache which |
43 |
- # references the depgraph. So that Package instances don't |
44 |
- # hold the depgraph and FakeVartree on the heap, replace |
45 |
- # the RootConfig that references the FakeVartree with the |
46 |
- # original RootConfig instance which references the actual |
47 |
- # vartree. |
48 |
- node.root_config = \ |
49 |
- self._trees_orig[node.root]["root_config"] |
50 |
- |
51 |
def _resolve_conflicts(self): |
52 |
if not self._complete_graph(): |
53 |
raise self._unknown_internal_error() |
54 |
|
55 |
-- |
56 |
gentoo-commits@l.g.o mailing list |