summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Górny <gentoo@mgorny.alt.pl>2010-07-14 10:28:12 +0200
committerZac Medico <zmedico@gentoo.org>2010-07-14 01:41:30 -0700
commita4281952780b0d91adbe75b2728d3d70e1974da6 (patch)
treec1618a9eadabe8cc23bf1d3f02f10650c8794d87
parent393c3752b59fdd3fd57410323ceb4a377264fa64 (diff)
downloadportage-a4281952780b0d91adbe75b2728d3d70e1974da6.tar.gz
portage-a4281952780b0d91adbe75b2728d3d70e1974da6.tar.bz2
portage-a4281952780b0d91adbe75b2728d3d70e1974da6.zip
Add EAPI 3-defined variables to the readonly check.
-rw-r--r--pym/repoman/checks.py9
1 files changed, 8 insertions, 1 deletions
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,