summaryrefslogtreecommitdiffstats
path: root/pym/_emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-10-20 18:21:42 +0000
committerZac Medico <zmedico@gentoo.org>2008-10-20 18:21:42 +0000
commit707e77d45f3f2b57a2576d158af4265785896c80 (patch)
tree3f5d17c75be7c20628b58397dda73d8220978c1f /pym/_emerge
parent17917af467622d8c528885929009e749ed1f7bef (diff)
downloadportage-707e77d45f3f2b57a2576d158af4265785896c80.tar.gz
portage-707e77d45f3f2b57a2576d158af4265785896c80.tar.bz2
portage-707e77d45f3f2b57a2576d158af4265785896c80.zip
Handle the case that was intended to be fixed by r11702 (which got reverted).
svn path=/main/trunk/; revision=11705
Diffstat (limited to 'pym/_emerge')
-rw-r--r--pym/_emerge/__init__.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 03ee50eca..0cca793d5 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -5677,6 +5677,22 @@ class depgraph(object):
if pkg.cp == cp]
break
+ # If the installed version is in a different slot and it is higher than
+ # the highest available visible package, _iter_atoms_for_pkg() may fail
+ # to properly match the available package with a corresponding argument
+ # atom. Detect this case and correct it here.
+ if not selective and len(matched_packages) > 1 and \
+ matched_packages[-1].installed and \
+ matched_packages[-1].slot_atom != \
+ matched_packages[-2].slot_atom and \
+ matched_packages[-1] > matched_packages[-2]:
+ pkg = matched_packages[-2]
+ if pkg.root == self.target_root and \
+ self._set_atoms.findAtomForPackage(pkg):
+ # Select the available package instead
+ # of the installed package.
+ matched_packages.pop()
+
if len(matched_packages) > 1:
bestmatch = portage.best(
[pkg.cpv for pkg in matched_packages])