summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-06-07 19:48:51 -0700
committerZac Medico <zmedico@gentoo.org>2013-06-07 20:00:03 -0700
commit55cd4ceae6ed39b52daaad89f111d87c25be9c9b (patch)
tree6fdcf4dc4f17b43f5e450b8f359ad31c3f3b200f
parentcache/template.py: call self.sync() from __del__ (diff)
downloadportage-55cd4ceae6ed39b52daaad89f111d87c25be9c9b.tar.gz
portage-55cd4ceae6ed39b52daaad89f111d87c25be9c9b.tar.bz2
portage-55cd4ceae6ed39b52daaad89f111d87c25be9c9b.zip
_iter_match_use: construct _pkg_str instancesv2.2.0_alpha178
Now _match_use does not have to construct them itself.
-rw-r--r--pym/portage/dbapi/__init__.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
index f954bad94..a20a1e84f 100644
--- a/pym/portage/dbapi/__init__.py
+++ b/pym/portage/dbapi/__init__.py
@@ -193,18 +193,27 @@ class dbapi(object):
except KeyError:
continue
+ try:
+ cpv.slot
+ except AttributeError:
+ try:
+ cpv = _pkg_str(cpv, metadata=metadata,
+ settings=self.settings)
+ except InvalidData:
+ continue
+
if not self._match_use(atom, cpv, metadata):
continue
yield cpv
- def _match_use(self, atom, cpv, metadata):
+ def _match_use(self, atom, pkg, metadata):
eapi_attrs = _get_eapi_attrs(metadata["EAPI"])
if eapi_attrs.iuse_effective:
iuse_implicit_match = self.settings._iuse_effective_match
else:
iuse_implicit_match = self.settings._iuse_implicit_match
- usealiases = self.settings._use_manager.getUseAliases(self._pkg_str(cpv, metadata["repository"]))
+ usealiases = self.settings._use_manager.getUseAliases(pkg)
iuse = Package._iuse(None, metadata["IUSE"].split(), iuse_implicit_match, usealiases, metadata["EAPI"])
for x in atom.unevaluated_atom.use.required:
@@ -245,12 +254,6 @@ class dbapi(object):
elif not self.settings.local_config:
# Check masked and forced flags for repoman.
- try:
- cpv.slot
- except AttributeError:
- pkg = _pkg_str(cpv, metadata=metadata, settings=self.settings)
- else:
- pkg = cpv
usemask = self.settings._getUseMask(pkg,
stable=self.settings._parent_stable)
if any(x in usemask for x in atom.use.enabled):