public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico (zmedico)" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] portage r10512 - main/branches/2.1.2/bin
Date: Fri, 30 May 2008 23:53:14 +0000	[thread overview]
Message-ID: <E1K2EPK-0003tt-Ev@stork.gentoo.org> (raw)

Author: zmedico
Date: 2008-05-30 23:53:13 +0000 (Fri, 30 May 2008)
New Revision: 10512

Modified:
   main/branches/2.1.2/bin/emerge
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. (trunk r10511)


Modified: main/branches/2.1.2/bin/emerge
===================================================================
--- main/branches/2.1.2/bin/emerge	2008-05-30 23:46:08 UTC (rev 10511)
+++ main/branches/2.1.2/bin/emerge	2008-05-30 23:53:13 UTC (rev 10512)
@@ -818,11 +818,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
 
+		# Atoms matched via PROVIDE must be temporarily transformed since
+		# match_from_list() only works correctly when atom.cp == pkg.cp.
+		rev_transform = {}
+		for atom in self.iterAtomsForPackage(pkg):
+			if atom.cp == pkg.cp:
+				rev_transform[atom] = atom
+			else:
+				rev_transform[portage_dep.Atom(atom.replace(atom.cp, pkg.cp, 1))] = atom
+		best_match = portage.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

-- 
gentoo-commits@lists.gentoo.org mailing list



                 reply	other threads:[~2008-05-30 23:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1K2EPK-0003tt-Ev@stork.gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox