"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",
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 EbuildQuote(LineCheck):
"""Ensure ebuilds have valid quoting around things like D,FILESDIR, etc..."""
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 = 'PATCHES is not a bash array on line: %d'
+
class EbuildQuotedA(LineCheck):
"""Ensure ebuilds have no quoting around ${A}"""
return "Quoted \"${A}\" on line: %d"
_constant_checks = tuple((c() for c in (
- EbuildQuote, EbuildUselessDodoc, EbuildUselessCdS,
- EbuildNestedDie, EbuildQuotedA)))
+ EbuildQuote, EbuildUselessDodoc,
+ EbuildUselessCdS, EbuildNestedDie,
+ EbuildPatches, EbuildQuotedA)))
def run_checks(contents):
for num, line in enumerate(contents):