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 1QPU0W-0004DM-D5 for garchives@archives.gentoo.org; Thu, 26 May 2011 06:25:20 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BA6F41C4C6; Thu, 26 May 2011 06:18:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8E80A1C4C6 for ; Thu, 26 May 2011 06:18:31 +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 57F2E1B400D for ; Thu, 26 May 2011 06:18:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id BBC4280505 for ; Thu, 26 May 2011 06:18:30 +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: <805a8535623c3a15fd22910e32780365a9f57857.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:2.1.9 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: 805a8535623c3a15fd22910e32780365a9f57857 Date: Thu, 26 May 2011 06:18:30 +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: 8562cb7669e9fd7adc2017b81f2eeca8 commit: 805a8535623c3a15fd22910e32780365a9f57857 Author: Zac Medico gentoo org> AuthorDate: Wed May 18 00:54:34 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu May 26 03:06:17 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D805a8535 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 283ea8d..b5c3ab8 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -5188,23 +5188,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