From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1R7ZpT-0004e2-2O for garchives@archives.gentoo.org; Sat, 24 Sep 2011 21:32:11 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2670B21C07E; Sat, 24 Sep 2011 21:32:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E7F6521C07E for ; Sat, 24 Sep 2011 21:32:02 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7EF651B4004 for ; Sat, 24 Sep 2011 21:32:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id CFD8180042 for ; Sat, 24 Sep 2011 21:32:01 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dbapi/porttree.py X-VCS-Directories: pym/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: c0e897575e41ec4b8367e05d5d53f658ed0fcf8a Date: Sat, 24 Sep 2011 21:32:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 6f732c267789e4eb89516b8b6319a5fa commit: c0e897575e41ec4b8367e05d5d53f658ed0fcf8a Author: Zac Medico gentoo org> AuthorDate: Sat Sep 24 21:31:48 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Sep 24 21:31:48 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dc0e89757 portdbapi.xmatch: combine minimum-all/*-visible This eliminates redundant code. --- pym/portage/dbapi/porttree.py | 29 ++++------------------------- 1 files changed, 4 insertions(+), 25 deletions(-) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.p= y index d5068ab..94b25e8 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -887,30 +887,8 @@ class portdbapi(dbapi): if len(myval) > 1: self._cpv_sort_ascending(myval) =20 - elif level =3D=3D "minimum-all": - # Find the minimum matching version. This is optimized to - # minimize the number of metadata accesses (improves performance - # especially in cases where metadata needs to be generated). - myval =3D "" - if mydep =3D=3D mykey: - for myval in self.cp_list(mykey, mytree=3Dmytree): - break - elif mydep.repo is not None: - for myval in self._iter_match(mydep, - self.cp_list(mykey, mytree=3Dmytree)): - break - else: - # We iterate over self.porttrees, since it's common to - # tweak this attribute in order to adjust match behavior. - for tree in self.porttrees: - repo =3D self.repositories.get_name_for_location(tree) - for myval in self._iter_match(mydep.with_repo(repo), - self.cp_list(mykey, mytree=3Dtree)): - break - if myval: - break - - elif level in ("match-visible", "minimum-visible", "bestmatch-visible"= ): + elif level in ("bestmatch-visible", "match-visible", + "minimum-all", "minimum-visible"): # Find the minimum matching visible version. This is optimized to # minimize the number of metadata accesses (improves performance # especially in cases where metadata needs to be generated). @@ -920,6 +898,7 @@ class portdbapi(dbapi): mylist =3D match_from_list(mydep, self.cp_list(mykey, mytree=3Dmytree)) =20 + visibility_filter =3D level !=3D "minimum-all" single_match =3D level !=3D "match-visible" myval =3D [] aux_keys =3D list(self._aux_cache_keys) @@ -946,7 +925,7 @@ class portdbapi(dbapi): # ebuild not in this repo, or masked by corruption continue =20 - if not self._visible(cpv, metadata): + if visibility_filter and not self._visible(cpv, metadata): continue =20 if mydep.slot is not None and \