Fix broken SLOT update logic in fakedbapi.cpv_inject().
authorZac Medico <zmedico@gentoo.org>
Sat, 9 Dec 2006 07:07:05 +0000 (07:07 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 9 Dec 2006 07:07:05 +0000 (07:07 -0000)
svn path=/main/trunk/; revision=5236

pym/portage.py

index 93a304b7394db96f270c05e4ea4acdbd77c2ccec..d07089a42009fd4569936744f4a472a021376d0b 100644 (file)
@@ -4405,9 +4405,13 @@ class fakedbapi(dbapi):
                if myslot and mycp in self.cpdict:
                        # If necessary, remove another package in the same SLOT.
                        for cpv in self.cpdict[mycp]:
-                               if mycpv != cpv and myslot == self.cpvdict[cpv]:
-                                       self.cpv_remove(cpv)
-                                       break
+                               if mycpv != cpv:
+                                       other_metadata = self.cpvdict[cpv]
+                                       if other_metadata:
+                                               other_slot = metadata.get("SLOT", None)
+                                               if myslot == other_slot:
+                                                       self.cpv_remove(cpv)
+                                                       break
                if mycp not in self.cpdict:
                        self.cpdict[mycp] = []
                if not mycpv in self.cpdict[mycp]: