summaryrefslogtreecommitdiffstats
path: root/pym/repoman
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-06-07 19:51:48 -0700
committerZac Medico <zmedico@gentoo.org>2012-06-07 19:51:48 -0700
commitdcdfed5f9487f4232affc156518e05e00c10da5f (patch)
treee56687d181db796d8e176777467b442cc4a789f3 /pym/repoman
parent9dbf4d7d7fb7c6d0284cc25d8322dd84292d6dd9 (diff)
downloadportage-dcdfed5f9487f4232affc156518e05e00c10da5f.tar.gz
portage-dcdfed5f9487f4232affc156518e05e00c10da5f.tar.bz2
portage-dcdfed5f9487f4232affc156518e05e00c10da5f.zip
InheritEclass: avoid false positive in func regex
Diffstat (limited to 'pym/repoman')
-rw-r--r--pym/repoman/checks.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 65f024ce4..2864d675d 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -469,7 +469,10 @@ class InheritEclass(LineCheck):
self._ignore_missing = ignore_missing
inherit_re = eclass
self._inherit_re = re.compile(r'^(\s*|.*[|&]\s*)\binherit\s(.*\s)?%s(\s|$)' % inherit_re)
- self._func_re = re.compile(r'\b(' + '|'.join(funcs) + r')\b')
+ # Match when the function is preceded only by leading whitespace or a shell
+ # operator such as (, {, |, ||, or &&. This prevents false postives in
+ # things like elog messages, as reported in bug #413285.
+ self._func_re = re.compile(r'(^|[|&{(])\s*\b(' + '|'.join(funcs) + r')\b')
def new(self, pkg):
self.repoman_check_name = 'inherit.missing'
@@ -493,7 +496,7 @@ class InheritEclass(LineCheck):
if s:
self._func_call = True
return '%s.eclass is not inherited, but "%s" found at line: %s' % \
- (self._eclass, s.group(0), '%d')
+ (self._eclass, s.group(2), '%d')
elif not self._func_call:
self._func_call = self._func_re.search(line)