From: Michał Górny Date: Wed, 14 Jul 2010 08:28:12 +0000 (+0200) Subject: Add EAPI 3-defined variables to the readonly check. X-Git-Tag: v2.2_rc68~504 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a4281952780b0d91adbe75b2728d3d70e1974da6;p=portage.git Add EAPI 3-defined variables to the readonly check. --- diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 96c7969ad..c60cef0ef 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -224,6 +224,13 @@ class EbuildAssignment(LineCheck): self.previous_line = line return e +class Eapi3EbuildAssignment(EbuildAssignment): + """Ensure ebuilds don't assign to readonly EAPI 3-introduced variables.""" + + readonly_assignment = re.compile(r'\s*(export\s+)?(ED|EPREFIX|EROOT)=') + + def check_eapi(self, eapi): + return eapi not in ('0', '1', '2') class EbuildNestedDie(LineCheck): """Check ebuild for nested die statements (die statements in subshells""" @@ -500,7 +507,7 @@ class Eapi4GoneVars(LineCheck): _constant_checks = tuple((c() for c in ( EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote, - EbuildAssignment, EbuildUselessDodoc, + EbuildAssignment, Eapi3EbuildAssignment, EbuildUselessDodoc, EbuildUselessCdS, EbuildNestedDie, EbuildPatches, EbuildQuotedA, EapiDefinition, IUseUndefined, InheritAutotools,