EverythingSet: always create SLOT atoms
authorZac Medico <zmedico@gentoo.org>
Thu, 21 Jul 2011 16:14:50 +0000 (09:14 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 21 Jul 2011 16:14:50 +0000 (09:14 -0700)
Before it would only include the SLOT in the atom if there were
multiple slots installed. However, taht could lead to unwanted upgrades
as reported in bug #338959. Therefore, always create SLOT atoms.

pym/portage/_sets/dbapi.py

index d32f1b7b8fc8314ec602f86ad9cf0b2ed793e604..0f238f044e393674d8c3d1144fa68432b9fb7f4f 100644 (file)
@@ -31,20 +31,12 @@ class EverythingSet(PackageSet):
                cp_list = self._db.cp_list
 
                for cp in self._db.cp_all():
-                       cpv_list = cp_list(cp)
-
-                       if len(cpv_list) > 1:
-                               for cpv in cpv_list:
-                                       slot, = aux_get(cpv, db_keys)
-                                       atom = Atom("%s:%s" % (cp, slot))
-                                       if self._filter:
-                                               if self._filter(atom):
-                                                       myatoms.append(atom)
-                                       else:
-                                               myatoms.append(atom)
-
-                       else:
-                               atom = Atom(cp)
+                       for cpv in cp_list(cp):
+                               # NOTE: Create SLOT atoms even when there is only one
+                               # SLOT installed, in order to avoid the possibility
+                               # of unwanted upgrades as reported in bug #338959.
+                               slot, = aux_get(cpv, db_keys)
+                               atom = Atom("%s:%s" % (cp, slot))
                                if self._filter:
                                        if self._filter(atom):
                                                myatoms.append(atom)