"EAPI.definition":"EAPI is defined after an inherit call (must be defined before)",
"EAPI.incompatible":"Ebuilds that use features that are only available with a different EAPI",
"EAPI.unsupported":"Ebuilds that have an unsupported EAPI version (you must upgrade portage)",
+ "SLOT.invalid":"Ebuilds that have an invalid SLOT variable value",
"SLOT.missing":"Ebuilds that have a missing or empty SLOT variable",
"HOMEPAGE.missing":"Ebuilds that have a missing or empty HOMEPAGE variable",
"DEPEND.bad":"User-visible ebuilds with bad DEPEND settings (matched against *visible* ebuilds)",
.TP
.B RESTRICT.syntax
Syntax error in RESTRICT (usually an extra/missing space/parenthesis)
+.B SLOT.invalid
+Ebuilds that have an invalid SLOT variable value
.TP
.B SLOT.missing
Ebuilds that have a missing or empty SLOT variable
import portage
from portage.cache.mappings import slot_dict_class
from portage.dep import paren_reduce, use_reduce, \
- paren_normalize, paren_enclose
+ paren_normalize, paren_enclose, _slot_re
from _emerge.Task import Task
if sys.hexversion >= 0x3000000:
self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
self.cp = portage.cpv_getkey(self.cpv)
slot = self.slot
- if not slot:
+ if _slot_re.match(slot) is None:
+ self._invalid_metadata('SLOT.invalid',
+ "SLOT: invalid value: '%s'" % slot)
# Avoid an InvalidAtom exception when creating slot_atom.
# This package instance will be masked due to empty SLOT.
slot = '0'