summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-11 23:59:13 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-11 23:59:13 +0000
commit6a8c1409c9999c54f770cd25ebad14bf30a37005 (patch)
tree17258019db99641a799035ce85a786653dbaa9e2
parent5ee93420b31ab1bb69e1d6f87ddfb9d70631a651 (diff)
downloadportage-6a8c1409c9999c54f770cd25ebad14bf30a37005.tar.gz
portage-6a8c1409c9999c54f770cd25ebad14bf30a37005.tar.bz2
portage-6a8c1409c9999c54f770cd25ebad14bf30a37005.zip
Bug #262211 - Avoid triggering an InvalidAtom exception inside the Package
constructor when SLOT is empty. svn path=/main/trunk/; revision=13061
-rw-r--r--pym/_emerge/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index d103f9ecf..a0b73dd19 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -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:]