When dblink.treewalk() looks for an installed instance in the same slot, make sure...
authorZac Medico <zmedico@gentoo.org>
Fri, 8 Jun 2007 19:28:06 +0000 (19:28 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 8 Jun 2007 19:28:06 +0000 (19:28 -0000)
svn path=/main/branches/2.1.2/; revision=6758

pym/portage.py

index 05283f3ffb6d810234b0fb735e1dc2276221ba6a..bbd5da93de5403c8418563bf754cc4f8451ffe0c 100644 (file)
@@ -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)