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 1QMV2m-0008Kp-TW for garchives@archives.gentoo.org; Wed, 18 May 2011 00:55:21 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 16DDC1C003; Wed, 18 May 2011 00:55:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id DA4E61C003 for ; Wed, 18 May 2011 00:55:12 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 493061B403C for ; Wed, 18 May 2011 00:55:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id ABB8B80504 for ; Wed, 18 May 2011 00:55:11 +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/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/depgraph.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: c746e1246f6977c78b00b068e824e2066e66f0f1 Date: Wed, 18 May 2011 00:55:11 +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: e80c0a86b0a61a8793c30c648963236e commit: c746e1246f6977c78b00b068e824e2066e66f0f1 Author: Zac Medico gentoo org> AuthorDate: Wed May 18 00:54:34 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed May 18 00:54:34 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dc746e124 display_autounmask: optimize check_if_latest --- pym/_emerge/depgraph.py | 31 ++++++++++++++++--------------- 1 files changed, 16 insertions(+), 15 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 609b4d5..9fb0cee 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -5551,23 +5551,24 @@ class depgraph(object): dbs =3D self._dynamic_config._filtered_trees[pkg.root]["dbs"] root_config =3D self._frozen_config.roots[pkg.root] =20 - all_cpv_by_slot =3D {} for db, pkg_type, built, installed, db_keys in dbs: for other_pkg in self._iter_match_pkgs(root_config, pkg_type, Atom(p= kg.cp)): - slot =3D other_pkg.metadata["SLOT"] - all_cpv_by_slot.setdefault(slot, set()) - all_cpv_by_slot[slot].add(other_pkg.cpv) - - all_cpv =3D [] - for cpvs in all_cpv_by_slot.values(): - all_cpv.extend(cpvs) - all_cpv.sort(key=3Dportage.versions.cpv_sort_key()) - - if all_cpv[-1] !=3D pkg.cpv: - is_latest =3D False - slot_cpvs =3D sorted(all_cpv_by_slot[pkg.metadata["SLOT"]], key=3Dpo= rtage.versions.cpv_sort_key()) - if slot_cpvs[-1] !=3D pkg.cpv: - is_latest_in_slot =3D False + if other_pkg.cp !=3D pkg.cp: + # old-style PROVIDE virtual means there are no + # normal matches for this pkg_type + break + if other_pkg > pkg: + is_latest =3D False + if other_pkg.slot_atom =3D=3D pkg.slot_atom: + is_latest_in_slot =3D False + break + else: + # iter_match_pkgs yields highest verion first, so + # there's no need to search this pkg_type any further + break + + if not is_latest_in_slot: + break =20 return is_latest, is_latest_in_slot =20