1 |
commit: a795b8f9c70223963dff2c12e2171c4e48920a37 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 29 23:43:21 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 29 23:43:21 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a795b8f9 |
7 |
|
8 |
Use dbapi._known_keys more. |
9 |
|
10 |
--- |
11 |
bin/egencache | 2 +- |
12 |
pym/_emerge/actions.py | 3 +-- |
13 |
pym/portage/dbapi/porttree.py | 18 ++++++------------ |
14 |
3 files changed, 8 insertions(+), 15 deletions(-) |
15 |
|
16 |
diff --git a/bin/egencache b/bin/egencache |
17 |
index 33839aa..afd2baa 100755 |
18 |
--- a/bin/egencache |
19 |
+++ b/bin/egencache |
20 |
@@ -204,7 +204,7 @@ class GenCache(object): |
21 |
tree = portdb.porttrees[0] |
22 |
self._portdb = portdb |
23 |
self._eclass_db = portdb._repo_info[tree].eclass_db |
24 |
- self._auxdbkeys = portage.auxdbkeys |
25 |
+ self._auxdbkeys = portdb._known_keys |
26 |
# We can globally cleanse stale cache only if we |
27 |
# iterate over every single cp. |
28 |
self._global_cleanse = cp_iter is None |
29 |
|
30 |
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py |
31 |
index 7a1bcb5..911d5ec 100644 |
32 |
--- a/pym/_emerge/actions.py |
33 |
+++ b/pym/_emerge/actions.py |
34 |
@@ -1646,8 +1646,7 @@ def action_metadata(settings, portdb, myopts, porttrees=None): |
35 |
if not os.path.exists(cachedir): |
36 |
os.makedirs(cachedir) |
37 |
|
38 |
- auxdbkeys = [x for x in portage.auxdbkeys if not x.startswith("UNUSED_0")] |
39 |
- auxdbkeys = tuple(auxdbkeys) |
40 |
+ auxdbkeys = portdb._known_keys |
41 |
|
42 |
class TreeData(object): |
43 |
__slots__ = ('dest_db', 'eclass_db', 'path', 'src_db', 'valid_nodes') |
44 |
|
45 |
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py |
46 |
index 5c45d97..9ad434f 100644 |
47 |
--- a/pym/portage/dbapi/porttree.py |
48 |
+++ b/pym/portage/dbapi/porttree.py |
49 |
@@ -25,7 +25,7 @@ from portage.exception import PortageException, \ |
50 |
FileNotFound, InvalidAtom, InvalidDependString, InvalidPackageName |
51 |
from portage.localization import _ |
52 |
|
53 |
-from portage import eclass_cache, auxdbkeys, \ |
54 |
+from portage import eclass_cache, \ |
55 |
eapi_is_supported, dep_check, \ |
56 |
_eapi_is_deprecated |
57 |
from portage import os |
58 |
@@ -181,23 +181,17 @@ class portdbapi(dbapi): |
59 |
'perms' : 0o664 |
60 |
}) |
61 |
|
62 |
- # XXX: REMOVE THIS ONCE UNUSED_0 IS YANKED FROM auxdbkeys |
63 |
- # ~harring |
64 |
- filtered_auxdbkeys = [x for x in auxdbkeys if not x.startswith("UNUSED_0")] |
65 |
- filtered_auxdbkeys.sort() |
66 |
- filtered_auxdbkeys = tuple(filtered_auxdbkeys) |
67 |
- self._filtered_auxdbkeys = filtered_auxdbkeys |
68 |
# If secpass < 1, we don't want to write to the cache |
69 |
# since then we won't be able to apply group permissions |
70 |
# to the cache entries/directories. |
71 |
if (secpass < 1 and not depcachedir_unshared) or not depcachedir_w_ok: |
72 |
for x in self.porttrees: |
73 |
self.auxdb[x] = volatile.database( |
74 |
- self.depcachedir, x, filtered_auxdbkeys, |
75 |
+ self.depcachedir, x, self._known_keys, |
76 |
**cache_kwargs) |
77 |
try: |
78 |
self._ro_auxdb[x] = self.auxdbmodule(self.depcachedir, x, |
79 |
- filtered_auxdbkeys, readonly=True, **cache_kwargs) |
80 |
+ self._known_keys, readonly=True, **cache_kwargs) |
81 |
except CacheError: |
82 |
pass |
83 |
else: |
84 |
@@ -206,7 +200,7 @@ class portdbapi(dbapi): |
85 |
continue |
86 |
# location, label, auxdbkeys |
87 |
self.auxdb[x] = self.auxdbmodule( |
88 |
- self.depcachedir, x, filtered_auxdbkeys, **cache_kwargs) |
89 |
+ self.depcachedir, x, self._known_keys, **cache_kwargs) |
90 |
if "metadata-transfer" not in self.settings.features: |
91 |
for x in self.porttrees: |
92 |
if x in self._pregen_auxdb: |
93 |
@@ -226,7 +220,7 @@ class portdbapi(dbapi): |
94 |
def _create_pregen_cache(self, tree): |
95 |
conf = self.repositories.get_repo_for_location(tree) |
96 |
cache = conf.get_pregenerated_cache( |
97 |
- self._filtered_auxdbkeys, readonly=True) |
98 |
+ self._known_keys, readonly=True) |
99 |
if cache is not None: |
100 |
try: |
101 |
cache.ec = self._repo_info[tree].eclass_db |
102 |
@@ -493,7 +487,7 @@ class portdbapi(dbapi): |
103 |
if aux_cache is not None: |
104 |
return [aux_cache.get(x, "") for x in mylist] |
105 |
cache_me = True |
106 |
- global auxdbkeys, auxdbkeylen |
107 |
+ |
108 |
try: |
109 |
cat, pkg = mycpv.split("/", 1) |
110 |
except ValueError: |