diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-09-24 12:27:39 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-09-24 12:27:39 -0700 |
commit | 13729a95fe68a51a0a18194a913fee4d3c17d160 (patch) | |
tree | 7f3411f7d3b59bc6d52cba6ea4345157cb38426e | |
parent | 5076fa35cdcba5a092f16c2004e90d4d84c01044 (diff) | |
download | portage-13729a95fe68a51a0a18194a913fee4d3c17d160.tar.gz portage-13729a95fe68a51a0a18194a913fee4d3c17d160.tar.bz2 portage-13729a95fe68a51a0a18194a913fee4d3c17d160.zip |
portdbapi: split _visible from _iter_visible
-rw-r--r-- | pym/portage/dbapi/porttree.py | 68 |
1 files changed, 35 insertions, 33 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index aaa69fa7a..09677146c 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -1026,10 +1026,6 @@ class portdbapi(dbapi): """ aux_keys = list(self._aux_cache_keys) metadata = {} - local_config = self.settings.local_config - chost = self.settings.get('CHOST', '') - accept_chost = self.settings._accept_chost - getMaskAtom = self.settings._getMaskAtom if len(self.porttrees) == 1: repos = [None] @@ -1056,41 +1052,47 @@ class portdbapi(dbapi): writemsg("!!! %s\n" % (e,), noiselevel=-1) del e continue - eapi = metadata["EAPI"] - if not eapi_is_supported(eapi): - continue - if _eapi_is_deprecated(eapi): - continue - if not metadata["SLOT"]: - continue - if getMaskAtom(mycpv, metadata): - continue - if self.settings._getMissingKeywords(mycpv, metadata): + + if not self._visible(mycpv, metadata): continue - if local_config: - metadata['CHOST'] = chost - if not accept_chost(mycpv, metadata): - continue - metadata["USE"] = "" - if "?" in metadata["LICENSE"] or \ - "?" in metadata["PROPERTIES"]: - self.doebuild_settings.setcpv(mycpv, mydb=metadata) - metadata['USE'] = \ - self.doebuild_settings['PORTAGE_USE'] - try: - if self.settings._getMissingLicenses( - mycpv, metadata): - continue - if self.settings._getMissingProperties( - mycpv, metadata): - continue - except InvalidDependString: - continue yield mycpv # only yield a given cpv once break + def _visible(self, cpv, metadata): + eapi = metadata["EAPI"] + if not eapi_is_supported(eapi): + return False + if _eapi_is_deprecated(eapi): + return False + if not metadata["SLOT"]: + return False + + settings = self.settings + if settings._getMaskAtom(cpv, metadata): + return False + if settings._getMissingKeywords(cpv, metadata): + return False + if settings.local_config: + metadata['CHOST'] = settings.get('CHOST', '') + if not settings._accept_chost(cpv, metadata): + return False + metadata["USE"] = "" + if "?" in metadata["LICENSE"] or \ + "?" in metadata["PROPERTIES"]: + self.doebuild_settings.setcpv(cpv, mydb=metadata) + metadata['USE'] = self.doebuild_settings['PORTAGE_USE'] + try: + if settings._getMissingLicenses(cpv, metadata): + return False + if settings._getMissingProperties(cpv, metadata): + return False + except InvalidDependString: + return False + + return True + def close_portdbapi_caches(): for i in portdbapi.portdbapi_instances: i.close_caches() |