diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-06-11 23:40:52 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-06-11 23:40:52 -0700 |
commit | 9a49a7c4189c55d2105ddf21b12321e7da3bf415 (patch) | |
tree | 7051739f1868cb116c780763ee16b78d698f30c2 /pym/portage/dbapi/porttree.py | |
parent | 8063586060f7d4abfa02639ba72c0e9b38ed634a (diff) | |
download | portage-9a49a7c4189c55d2105ddf21b12321e7da3bf415.tar.gz portage-9a49a7c4189c55d2105ddf21b12321e7da3bf415.tar.bz2 portage-9a49a7c4189c55d2105ddf21b12321e7da3bf415.zip |
dbapi: construct _pkg_str during match on-demand
Diffstat (limited to 'pym/portage/dbapi/porttree.py')
-rw-r--r-- | pym/portage/dbapi/porttree.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index c5ee7707b..df681152c 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -22,7 +22,8 @@ from portage.cache.cache_errors import CacheError from portage.cache.mappings import Mapping from portage.dbapi import dbapi from portage.exception import PortageException, \ - FileNotFound, InvalidAtom, InvalidDependString, InvalidPackageName + FileNotFound, InvalidAtom, InvalidData, \ + InvalidDependString, InvalidPackageName from portage.localization import _ from portage import eclass_cache, \ @@ -825,18 +826,24 @@ class portdbapi(dbapi): # ebuild not in this repo, or masked by corruption continue - if visibility_filter and not self._visible(cpv, metadata): + try: + pkg_str = _pkg_str(cpv, slot=metadata["SLOT"], + repo=metadata["repository"], eapi=metadata["EAPI"]) + except InvalidData: + continue + + if visibility_filter and not self._visible(pkg_str, metadata): continue if mydep.slot is not None and \ - mydep.slot != metadata["SLOT"]: + mydep.slot != pkg_str.slot: continue if mydep.unevaluated_atom.use is not None and \ - not self._match_use(mydep, cpv, metadata): + not self._match_use(mydep, pkg_str, metadata): continue - myval.append(cpv) + myval.append(pkg_str) # only yield a given cpv once break |