"changelog.missing":"Missing ChangeLog files",
"ebuild.disjointed":"Ebuilds not added to cvs when the matching digest has been added",
"ebuild.notadded":"Ebuilds that exist but have not been added to cvs",
+ "ebuild.patches":"PATCHES variable should be a bash array to ensure white space safety",
"changelog.notadded":"ChangeLogs that exist but have not been added to cvs",
"filedir.missing":"Package lacks a files directory",
"file.executable":"Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do note need the executable bit",
"RESTRICT.invalid",
"ebuild.minorsyn",
"ebuild.badheader",
+"ebuild.patches",
"file.size",
"java.eclassesnotused",
"metadata.missing",
.B ebuild.output
A simple sourcing of the ebuild produces output; this breaks ebuild policy.
.TP
+.B ebuild.patches
+PATCHES variable should be a bash array to ensure white space safety
+.TP
.B ebuild.syntax
Error generating cache entry for ebuild; typically caused by ebuild syntax error
or digest verification failure.
def check(self, num, line):
"""Run the check on line and return error if there is one"""
- pass
-
+ if self.re.match(line):
+ return self.error
class EbuildHeader(LineCheck):
"""Ensure ebuilds have proper headers
elif self.method_re.match(line):
self.check_next_line = True
+class EbuildPatches(LineCheck):
+ """Ensure ebuilds use bash arrays for PATCHES to ensure white space safety"""
+ repoman_check_name = 'ebuild.patches'
+ re = re.compile(r'^\s*PATCHES=[^\(]')
+ error = errors.PATCHES_ERROR
class EbuildQuotedA(LineCheck):
"""Ensure ebuilds have no quoting around ${A}"""
_constant_checks = tuple((c() for c in (
EbuildWhitespace, EbuildQuote,
EbuildAssignment, EbuildUselessDodoc,
- EbuildUselessCdS, EbuildNestedDie, EbuildQuotedA)))
+ EbuildUselessCdS, EbuildNestedDie,
+ EbuildPatches, EbuildQuotedA)))
def run_checks(contents, st_mtime):
checks = list(_constant_checks)
READONLY_ASSIGNMENT_ERROR = 'Ebuild contains assignment to read-only variable on line: %d'
MISSING_QUOTES_ERROR = 'Unquoted Variable on line: %d'
NESTED_DIE_ERROR = 'Ebuild calls die in a subshell on line: %d'
+PATCHES_ERROR = 'PATCHES is not a bash array on line: %d'
REDUNDANT_CD_S_ERROR = 'Ebuild has redundant cd ${S} statement on line: %d'