From a795b8f9c70223963dff2c12e2171c4e48920a37 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 29 Oct 2011 16:43:21 -0700 Subject: Use dbapi._known_keys more. --- pym/_emerge/actions.py | 3 +-- pym/portage/dbapi/porttree.py | 18 ++++++------------ 2 files changed, 7 insertions(+), 14 deletions(-) (limited to 'pym') diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 7a1bcb5f8..911d5ec2e 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1646,8 +1646,7 @@ def action_metadata(settings, portdb, myopts, porttrees=None): if not os.path.exists(cachedir): os.makedirs(cachedir) - auxdbkeys = [x for x in portage.auxdbkeys if not x.startswith("UNUSED_0")] - auxdbkeys = tuple(auxdbkeys) + auxdbkeys = portdb._known_keys class TreeData(object): __slots__ = ('dest_db', 'eclass_db', 'path', 'src_db', 'valid_nodes') diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 5c45d97c7..9ad434f41 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -25,7 +25,7 @@ from portage.exception import PortageException, \ FileNotFound, InvalidAtom, InvalidDependString, InvalidPackageName from portage.localization import _ -from portage import eclass_cache, auxdbkeys, \ +from portage import eclass_cache, \ eapi_is_supported, dep_check, \ _eapi_is_deprecated from portage import os @@ -181,23 +181,17 @@ class portdbapi(dbapi): 'perms' : 0o664 }) - # XXX: REMOVE THIS ONCE UNUSED_0 IS YANKED FROM auxdbkeys - # ~harring - filtered_auxdbkeys = [x for x in auxdbkeys if not x.startswith("UNUSED_0")] - filtered_auxdbkeys.sort() - filtered_auxdbkeys = tuple(filtered_auxdbkeys) - self._filtered_auxdbkeys = filtered_auxdbkeys # If secpass < 1, we don't want to write to the cache # since then we won't be able to apply group permissions # to the cache entries/directories. if (secpass < 1 and not depcachedir_unshared) or not depcachedir_w_ok: for x in self.porttrees: self.auxdb[x] = volatile.database( - self.depcachedir, x, filtered_auxdbkeys, + self.depcachedir, x, self._known_keys, **cache_kwargs) try: self._ro_auxdb[x] = self.auxdbmodule(self.depcachedir, x, - filtered_auxdbkeys, readonly=True, **cache_kwargs) + self._known_keys, readonly=True, **cache_kwargs) except CacheError: pass else: @@ -206,7 +200,7 @@ class portdbapi(dbapi): continue # location, label, auxdbkeys self.auxdb[x] = self.auxdbmodule( - self.depcachedir, x, filtered_auxdbkeys, **cache_kwargs) + self.depcachedir, x, self._known_keys, **cache_kwargs) if "metadata-transfer" not in self.settings.features: for x in self.porttrees: if x in self._pregen_auxdb: @@ -226,7 +220,7 @@ class portdbapi(dbapi): def _create_pregen_cache(self, tree): conf = self.repositories.get_repo_for_location(tree) cache = conf.get_pregenerated_cache( - self._filtered_auxdbkeys, readonly=True) + self._known_keys, readonly=True) if cache is not None: try: cache.ec = self._repo_info[tree].eclass_db @@ -493,7 +487,7 @@ class portdbapi(dbapi): if aux_cache is not None: return [aux_cache.get(x, "") for x in mylist] cache_me = True - global auxdbkeys, auxdbkeylen + try: cat, pkg = mycpv.split("/", 1) except ValueError: -- cgit v1.2.3-1-g7c22