Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13248 - main/trunk/pym/_emerge
Date: Sun, 29 Mar 2009 22:26:56
Message-Id: E1Lo3Sw-0008Pk-L6@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-03-29 22:26:53 +0000 (Sun, 29 Mar 2009)
3 New Revision: 13248
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 Log:
8 Inside depgraph.validate_blockers(), prevent false positives in PROVIDE
9 virtual blocker matches that can occur for packages for packages that don't
10 actual have the appropriate value in PROVIDE (triggered by profile 'virtuals'
11 settings). Thanks to Ned Ludd <solar@g.o> for reporting.
12
13
14 Modified: main/trunk/pym/_emerge/__init__.py
15 ===================================================================
16 --- main/trunk/pym/_emerge/__init__.py 2009-03-29 19:32:57 UTC (rev 13247)
17 +++ main/trunk/pym/_emerge/__init__.py 2009-03-29 22:26:53 UTC (rev 13248)
18 @@ -6754,10 +6754,15 @@
19 final_db = self.mydbapi[myroot]
20
21 provider_virtual = False
22 - if blocker.cp in virtuals and \
23 + if blocker.cp.startswith('virtual/') and \
24 not self._have_new_virt(blocker.root, blocker.cp):
25 provider_virtual = True
26
27 + # Use this to check PROVIDE for each matched package
28 + # when necessary.
29 + atom_set = InternalPackageSet(
30 + initial_atoms=[blocker.atom])
31 +
32 if provider_virtual:
33 atoms = []
34 for provider_entry in virtuals[blocker.cp]:
35 @@ -6768,13 +6773,17 @@
36 else:
37 atoms = [blocker.atom]
38
39 - blocked_initial = []
40 + blocked_initial = set()
41 for atom in atoms:
42 - blocked_initial.extend(initial_db.match_pkgs(atom))
43 + for pkg in initial_db.match_pkgs(atom):
44 + if atom_set.findAtomForPackage(pkg):
45 + blocked_initial.add(pkg)
46
47 - blocked_final = []
48 + blocked_final = set()
49 for atom in atoms:
50 - blocked_final.extend(final_db.match_pkgs(atom))
51 + for pkg in final_db.match_pkgs(atom):
52 + if atom_set.findAtomForPackage(pkg):
53 + blocked_final.add(pkg)
54
55 if not blocked_initial and not blocked_final:
56 parent_pkgs = self._blocker_parents.parent_nodes(blocker)