"LICENSE.missing":"Ebuilds that have a missing or empty LICENSE variable",
"DESCRIPTION.missing":"Ebuilds that have a missing or empty DESCRIPTION variable",
"DESCRIPTION.toolong":"DESCRIPTION is over %d characters" % max_desc_len,
+ "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.missing":"Ebuilds that have a missing or empty SLOT variable",
elif self.method_re.match(line):
self.check_next_line = True
+class EapiDefinition(LineCheck):
+ """ Check that EAPI is defined before inherits"""
+ repoman_check_name = 'EAPI.definition'
+
+ eapi_re = re.compile(r'^EAPI=')
+ inherit_re = re.compile(r'^\s*inherit\s')
+
+ def new(self, pkg):
+ self.inherit_line = None
+
+ def check(self, num, line):
+ if self.eapi_re.match(line) is not None:
+ if self.inherit_line is not None:
+ return errors.EAPI_DEFINED_AFTER_INHERIT
+ elif self.inherit_re.match(line) is not None:
+ self.inherit_line = line
+
class EbuildPatches(LineCheck):
"""Ensure ebuilds use bash arrays for PATCHES to ensure white space safety"""
repoman_check_name = 'ebuild.patches'
EbuildHeader, EbuildWhitespace, EbuildQuote,
EbuildAssignment, EbuildUselessDodoc,
EbuildUselessCdS, EbuildNestedDie,
- EbuildPatches, EbuildQuotedA,
+ EbuildPatches, EbuildQuotedA, EapiDefinition,
IUseUndefined, ImplicitRuntimeDeps, InheritAutotools,
EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS,
DeprecatedBindnowFlags, WantAutoDefaultValue)))