When dblink.treewalk() looks for an installed instance in the same slot, make sure...
authorZac Medico <zmedico@gentoo.org>
Tue, 5 Jun 2007 23:34:04 +0000 (23:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 5 Jun 2007 23:34:04 +0000 (23:34 -0000)
svn path=/main/trunk/; revision=6737

pym/portage/dbapi/vartree.py

index 60f893f0c57fa15c5e6307b1579cc69859f6a194..5b9635d694763c74827c611a7a747cc2542c0838 100644 (file)
@@ -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)