Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10512 - main/branches/2.1.2/bin
Date: Fri, 30 May 2008 23:53:19
Message-Id: E1K2EPK-0003tt-Ev@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-05-30 23:53:13 +0000 (Fri, 30 May 2008)
3 New Revision: 10512
4
5 Modified:
6 main/branches/2.1.2/bin/emerge
7 Log:
8 Fix PackageSet.findAtomForPackage() to find the most specific atom since
9 it can affect behavior when deciding whether or not to add a slot atom to
10 the world file. (trunk r10511)
11
12
13 Modified: main/branches/2.1.2/bin/emerge
14 ===================================================================
15 --- main/branches/2.1.2/bin/emerge 2008-05-30 23:46:08 UTC (rev 10511)
16 +++ main/branches/2.1.2/bin/emerge 2008-05-30 23:53:13 UTC (rev 10512)
17 @@ -818,11 +818,20 @@
18 None if there are no matches. This matches virtual arguments against
19 the PROVIDE metadata. This can raise an InvalidDependString exception
20 if an error occurs while parsing PROVIDE."""
21 - try:
22 - return self.iterAtomsForPackage(pkg).next()
23 - except StopIteration:
24 - return None
25
26 + # Atoms matched via PROVIDE must be temporarily transformed since
27 + # match_from_list() only works correctly when atom.cp == pkg.cp.
28 + rev_transform = {}
29 + for atom in self.iterAtomsForPackage(pkg):
30 + if atom.cp == pkg.cp:
31 + rev_transform[atom] = atom
32 + else:
33 + rev_transform[portage_dep.Atom(atom.replace(atom.cp, pkg.cp, 1))] = atom
34 + best_match = portage.best_match_to_list(pkg, rev_transform.iterkeys())
35 + if best_match:
36 + return rev_transform[best_match]
37 + return None
38 +
39 def iterAtomsForPackage(self, pkg):
40 """
41 Find all matching atoms for a given package. This matches virtual
42
43 --
44 gentoo-commits@l.g.o mailing list