From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1K2EIY-0006Wv-Vv for garchives@archives.gentoo.org; Fri, 30 May 2008 23:46:15 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D6275E0453; Fri, 30 May 2008 23:46:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B2ED8E0453 for ; Fri, 30 May 2008 23:46:13 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 4FE3267543 for ; Fri, 30 May 2008 23:46:13 +0000 (UTC) Received: from zmedico by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1K2EIT-0003Wq-AM for gentoo-commits@lists.gentoo.org; Fri, 30 May 2008 23:46:09 +0000 To: gentoo-commits@lists.gentoo.org From: "Zac Medico (zmedico)" Subject: [gentoo-commits] portage r10511 - main/trunk/pym/portage/sets X-VCS-Repository: portage X-VCS-Revision: 10511 X-VCS-Files: main/trunk/pym/portage/sets/base.py X-VCS-Directories: main/trunk/pym/portage/sets X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico Content-Type: text/plain; charset=UTF-8 Message-Id: Sender: Zac Medico Date: Fri, 30 May 2008 23:46:09 +0000 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: f919ef35-c08d-4352-bc63-b79a67f16957 X-Archives-Hash: 9b9d34f0578707234279faad1e4e5088 Author: zmedico Date: 2008-05-30 23:46:08 +0000 (Fri, 30 May 2008) New Revision: 10511 Modified: main/trunk/pym/portage/sets/base.py Log: Fix PackageSet.findAtomForPackage() to find the most specific atom since it can affect behavior when deciding whether or not to add a slot atom to the world file. Modified: main/trunk/pym/portage/sets/base.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- main/trunk/pym/portage/sets/base.py 2008-05-30 21:20:11 UTC (rev 1051= 0) +++ main/trunk/pym/portage/sets/base.py 2008-05-30 23:46:08 UTC (rev 1051= 1) @@ -105,11 +105,20 @@ None if there are no matches. This matches virtual arguments against the PROVIDE metadata. This can raise an InvalidDependString exception if an error occurs while parsing PROVIDE.""" - try: - return self.iterAtomsForPackage(pkg).next() - except StopIteration: - return None =20 + # Atoms matched via PROVIDE must be temporarily transformed since + # match_from_list() only works correctly when atom.cp =3D=3D pkg.cp. + rev_transform =3D {} + for atom in self.iterAtomsForPackage(pkg): + if atom.cp =3D=3D pkg.cp: + rev_transform[atom] =3D atom + else: + rev_transform[Atom(atom.replace(atom.cp, pkg.cp, 1))] =3D atom + best_match =3D best_match_to_list(pkg, rev_transform.iterkeys()) + if best_match: + return rev_transform[best_match] + return None + def iterAtomsForPackage(self, pkg): """ Find all matching atoms for a given package. This matches virtual --=20 gentoo-commits@lists.gentoo.org mailing list