From a4281952780b0d91adbe75b2728d3d70e1974da6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 14 Jul 2010 10:28:12 +0200 Subject: [PATCH] Add EAPI 3-defined variables to the readonly check. --- pym/repoman/checks.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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, -- 2.26.2