From a0adfb21ec64da8013265adfb2ed9ffb18e6a2b4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 8 Oct 2012 07:34:09 -0700 Subject: repoman: check EXTRA_ECONF/EMAKE, bug #437348 --- pym/repoman/checks.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'pym/repoman') diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 7e3d4b875..b47028ca7 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -785,6 +785,19 @@ class PortageInternal(LineCheck): if m is not None: return ("'%s'" % m.group(2)) + " called on line: %d" +class PortageInternalVariableAssignment(LineCheck): + + repoman_check_name = 'portage.internal' + internal_assignment = re.compile(r'\s*(export\s+)?(EXTRA_ECONF|EXTRA_EMAKE)\+?=') + + def check(self, num, line): + match = self.internal_assignment.match(line) + e = None + if match is not None: + e = 'Assignment to variable %s' % match.group(2) + e += ' on line: %d' + return e + _constant_checks = tuple(chain((c() for c in ( EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote, EbuildAssignment, Eapi3EbuildAssignment, EbuildUselessDodoc, @@ -796,7 +809,7 @@ _constant_checks = tuple(chain((c() for c in ( SrcCompileEconf, Eapi3DeprecatedFuncs, NoOffsetWithHelpers, Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse, PreserveOldLib, SandboxAddpredict, PortageInternal, - DeprecatedUseq, DeprecatedHasq)), + PortageInternalVariableAssignment, DeprecatedUseq, DeprecatedHasq)), (InheritEclass(k, **kwargs) for k, kwargs in _eclass_info.items()))) _here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$') -- cgit v1.2.3-1-g7c22