diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-06-08 19:28:06 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-06-08 19:28:06 +0000 |
commit | ba79ae3598f97889a71797a8b1f9cb393c868653 (patch) | |
tree | 444a8c9da49dcb53c6645444237ce2f8367f737d | |
parent | c79efeffb25bb5c204163c6e2850e65b9b8566d9 (diff) | |
download | portage-ba79ae3598f97889a71797a8b1f9cb393c868653.tar.gz portage-ba79ae3598f97889a71797a8b1f9cb393c868653.tar.bz2 portage-ba79ae3598f97889a71797a8b1f9cb393c868653.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. (trunk r6737)
svn path=/main/branches/2.1.2/; revision=6758
-rw-r--r-- | pym/portage.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pym/portage.py b/pym/portage.py index 05283f3ff..bbd5da93d 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -7307,6 +7307,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) |