1 |
Author: grobian |
2 |
Date: 2008-06-25 18:49:44 +0000 (Wed, 25 Jun 2008) |
3 |
New Revision: 10784 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/bin/repoman |
7 |
main/branches/prefix/pym/_emerge/__init__.py |
8 |
main/branches/prefix/pym/portage/dbapi/vartree.py |
9 |
Log: |
10 |
Merged from trunk 10781:10783 |
11 |
|
12 |
| 10782 | After the depgraph caches the vardb state in a FakeVartree, | |
13 |
| zmedico | to make some room on the heap, clear the vardbapi caches. | |
14 |
|
15 |
| 10783 | Fix repoman breakage wrt _PackageMetadataWrapper._keys | |
16 |
| zmedico | values. | |
17 |
|
18 |
|
19 |
Modified: main/branches/prefix/bin/repoman |
20 |
=================================================================== |
21 |
--- main/branches/prefix/bin/repoman 2008-06-25 12:41:22 UTC (rev 10783) |
22 |
+++ main/branches/prefix/bin/repoman 2008-06-25 18:49:44 UTC (rev 10784) |
23 |
@@ -355,7 +355,8 @@ |
24 |
] |
25 |
|
26 |
missingvars=["KEYWORDS","LICENSE","DESCRIPTION","HOMEPAGE","SLOT"] |
27 |
-allvars = set(portage.auxdbkeys) |
28 |
+allvars = set(x for x in portage.auxdbkeys if not x.startswith("UNUSED_")) |
29 |
+allvars.discard("CDEPEND") |
30 |
allvars.update(Package.metadata_keys) |
31 |
allvars = sorted(allvars) |
32 |
commitmessage=None |
33 |
|
34 |
Modified: main/branches/prefix/pym/_emerge/__init__.py |
35 |
=================================================================== |
36 |
--- main/branches/prefix/pym/_emerge/__init__.py 2008-06-25 12:41:22 UTC (rev 10783) |
37 |
+++ main/branches/prefix/pym/_emerge/__init__.py 2008-06-25 18:49:44 UTC (rev 10784) |
38 |
@@ -1402,7 +1402,11 @@ |
39 |
""" |
40 |
Detect metadata updates and synchronize Package attributes. |
41 |
""" |
42 |
- _keys = Package.metadata_keys |
43 |
+ _keys = set(x for x in portage.auxdbkeys \ |
44 |
+ if not x.startswith("UNUSED_")) |
45 |
+ _keys.discard("CDEPEND") |
46 |
+ _keys.update(Package.metadata_keys) |
47 |
+ _keys = tuple(sorted(_keys)) |
48 |
__slots__ = ("__weakref__", "_pkg") + tuple("_val_" + k for k in _keys) |
49 |
_wrapped_keys = frozenset( |
50 |
["COUNTER", "INHERITED", "IUSE", "SLOT", "USE", "_mtime_"]) |
51 |
@@ -2052,6 +2056,14 @@ |
52 |
# This triggers metadata updates via FakeVartree. |
53 |
vardb.aux_get(pkg.cpv, []) |
54 |
fakedb.cpv_inject(pkg) |
55 |
+ |
56 |
+ # Now that the vardb state is cached in our FakeVartree, |
57 |
+ # we won't be needing the real vartree cache for awhile. |
58 |
+ # To make some room on the heap, clear the vardbapi |
59 |
+ # caches. |
60 |
+ trees[myroot]["vartree"].dbapi._clear_cache() |
61 |
+ gc.collect() |
62 |
+ |
63 |
self.mydbapi[myroot] = fakedb |
64 |
def graph_tree(): |
65 |
pass |
66 |
|
67 |
Modified: main/branches/prefix/pym/portage/dbapi/vartree.py |
68 |
=================================================================== |
69 |
--- main/branches/prefix/pym/portage/dbapi/vartree.py 2008-06-25 12:41:22 UTC (rev 10783) |
70 |
+++ main/branches/prefix/pym/portage/dbapi/vartree.py 2008-06-25 18:49:44 UTC (rev 10784) |
71 |
@@ -691,13 +691,19 @@ |
72 |
def checkblockers(self, origdep): |
73 |
pass |
74 |
|
75 |
+ def _clear_cache(self): |
76 |
+ self.mtdircache.clear() |
77 |
+ self.matchcache.clear() |
78 |
+ self.cpcache.clear() |
79 |
+ self._aux_cache_obj = None |
80 |
+ |
81 |
def _add(self, pkg_dblink): |
82 |
- self._clear_cache(pkg_dblink) |
83 |
+ self._clear_pkg_cache(pkg_dblink) |
84 |
|
85 |
def _remove(self, pkg_dblink): |
86 |
- self._clear_cache(pkg_dblink) |
87 |
+ self._clear_pkg_cache(pkg_dblink) |
88 |
|
89 |
- def _clear_cache(self, pkg_dblink): |
90 |
+ def _clear_pkg_cache(self, pkg_dblink): |
91 |
# Due to 1 second mtime granularity in <python-2.5, mtime checks |
92 |
# are not always sufficient to invalidate vardbapi caches. Therefore, |
93 |
# the caches need to be actively invalidated here. |
94 |
|
95 |
-- |
96 |
gentoo-commits@l.g.o mailing list |