From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 13E7F1381F3 for ; Sat, 8 Jun 2013 03:00:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E5266E07A0; Sat, 8 Jun 2013 03:00:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6039DE07A0 for ; Sat, 8 Jun 2013 03:00:32 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6927333E548 for ; Sat, 8 Jun 2013 03:00:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 90A21E468F for ; Sat, 8 Jun 2013 03:00:29 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1370660403.55cd4ceae6ed39b52daaad89f111d87c25be9c9b.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dbapi/__init__.py X-VCS-Directories: pym/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 55cd4ceae6ed39b52daaad89f111d87c25be9c9b X-VCS-Branch: master Date: Sat, 8 Jun 2013 03:00:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 1626fdc2-70ff-4f55-be36-943dc7e6f8ee X-Archives-Hash: 9ffbd83ba2a767df81841b9bf663105d commit: 55cd4ceae6ed39b52daaad89f111d87c25be9c9b Author: Zac Medico gentoo org> AuthorDate: Sat Jun 8 02:48:51 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Jun 8 03:00:03 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=55cd4cea _iter_match_use: construct _pkg_str instances Now _match_use does not have to construct them itself. --- pym/portage/dbapi/__init__.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index f954bad..a20a1e8 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):