Bug #262211 - Avoid triggering an InvalidAtom exception inside the Package
authorZac Medico <zmedico@gentoo.org>
Thu, 12 Mar 2009 05:54:56 +0000 (05:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 12 Mar 2009 05:54:56 +0000 (05:54 -0000)
constructor when SLOT is empty. (trunk r13061)

svn path=/main/branches/2.1.6/; revision=13075

pym/_emerge/__init__.py

index 878812b9a42ca270534021e4046ceeb142197057..6cc58c71b3db7e57d5709c56c579b0e3289c0d4c 100644 (file)
@@ -1549,7 +1549,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:]