Bug #262211 - Avoid triggering an InvalidAtom exception inside the Package
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 23:59:13 +0000 (23:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 23:59:13 +0000 (23:59 -0000)
constructor when SLOT is empty.

svn path=/main/trunk/; revision=13061

pym/_emerge/__init__.py

index d103f9ecfdfb349365a35733815b90a891e782c2..a0b73dd19fde7d68c3511b2b1a62b2b51c079605 100644 (file)
@@ -1568,7 +1568,12 @@ class Package(Task):
                self.root = self.root_config.root
                self.metadata = _PackageMetadataWrapper(self, self.metadata)
                self.cp = portage.cpv_getkey(self.cpv)
-               self.slot_atom = portage.dep.Atom("%s:%s" % (self.cp, self.slot))
+               slot = self.slot
+               if not slot:
+                       # Avoid an InvalidAtom exception when creating slot_atom.
+                       # This package instance will be masked due to empty SLOT.
+                       slot = '0'
+               self.slot_atom = portage.dep.Atom("%s:%s" % (self.cp, slot))
                self.category, self.pf = portage.catsplit(self.cpv)
                self.cpv_split = portage.catpkgsplit(self.cpv)
                self.pv_split = self.cpv_split[1:]