Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11705 - main/trunk/pym/_emerge
Date: Mon, 20 Oct 2008 18:21:46
Message-Id: E1KrzNw-0001Yb-FL@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-10-20 18:21:42 +0000 (Mon, 20 Oct 2008)
3 New Revision: 11705
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 Log:
8 Handle the case that was intended to be fixed by r11702 (which got reverted).
9
10
11 Modified: main/trunk/pym/_emerge/__init__.py
12 ===================================================================
13 --- main/trunk/pym/_emerge/__init__.py 2008-10-20 00:44:52 UTC (rev 11704)
14 +++ main/trunk/pym/_emerge/__init__.py 2008-10-20 18:21:42 UTC (rev 11705)
15 @@ -5677,6 +5677,22 @@
16 if pkg.cp == cp]
17 break
18
19 + # If the installed version is in a different slot and it is higher than
20 + # the highest available visible package, _iter_atoms_for_pkg() may fail
21 + # to properly match the available package with a corresponding argument
22 + # atom. Detect this case and correct it here.
23 + if not selective and len(matched_packages) > 1 and \
24 + matched_packages[-1].installed and \
25 + matched_packages[-1].slot_atom != \
26 + matched_packages[-2].slot_atom and \
27 + matched_packages[-1] > matched_packages[-2]:
28 + pkg = matched_packages[-2]
29 + if pkg.root == self.target_root and \
30 + self._set_atoms.findAtomForPackage(pkg):
31 + # Select the available package instead
32 + # of the installed package.
33 + matched_packages.pop()
34 +
35 if len(matched_packages) > 1:
36 bestmatch = portage.best(
37 [pkg.cpv for pkg in matched_packages])