diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-06-05 23:34:04 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-06-05 23:34:04 +0000 |
commit | 6e1511af0ec50551b453f7848b4c5ee4c0ae7049 (patch) | |
tree | af8dd8600b57e6e14aa2eea79738cb43fb7c4e4a | |
parent | 5db79baa543b6ea665f7b57c47997643d2e549b2 (diff) | |
download | portage-6e1511af0ec50551b453f7848b4c5ee4c0ae7049.tar.gz portage-6e1511af0ec50551b453f7848b4c5ee4c0ae7049.tar.bz2 portage-6e1511af0ec50551b453f7848b4c5ee4c0ae7049.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.
svn path=/main/trunk/; revision=6737
-rw-r--r-- | pym/portage/dbapi/vartree.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 60f893f0c..5b9635d69 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1505,6 +1505,14 @@ class dblink(object): "%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) |