summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-30 03:11:58 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-30 03:11:58 +0000
commitd97ebe27ec1f45b191f60d55c0d710978df4d6ad (patch)
tree56cb12775c596e2f0d50d3a8d66948d0017d0ddb /pym
parent0988626678159719909d93917bae53f9c7ffefa1 (diff)
downloadportage-d97ebe27ec1f45b191f60d55c0d710978df4d6ad.tar.gz
portage-d97ebe27ec1f45b191f60d55c0d710978df4d6ad.tar.bz2
portage-d97ebe27ec1f45b191f60d55c0d710978df4d6ad.zip
When dblink.treewalk() looks for an installed instance in the same slot, make sure that it selects the one with the highest COUNTER in case there are multiple matches. (branches/2.1.2 r6758)
svn path=/main/branches/2.1.2.9/; revision=7448
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pym/portage.py b/pym/portage.py
index ea1f820e7..e4df2ddd6 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -7304,6 +7304,14 @@ class dblink:
"%s:%s" % (self.mysplit[0], self.settings["SLOT"]))
if slot_matches:
# Used by self.isprotected().
+ max_cpv = None
+ max_counter = -1
+ for cur_cpv in slot_matches:
+ cur_counter = self.vartree.dbapi.cpv_counter(cur_cpv)
+ if cur_counter > max_counter:
+ max_counter = cur_counter
+ max_cpv = cur_cpv
+ slot_matches = [max_cpv]
self._installed_instance = dblink(self.cat,
catsplit(slot_matches[0])[1], destroot, self.settings,
vartree=self.vartree)