diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-06-08 19:03:42 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-06-08 19:03:42 -0700 |
commit | a199763028a451389a92b8e58cab20cda83710b5 (patch) | |
tree | ab1c41c1b8f87f19b755ccb0215f54c6831ae542 | |
parent | 50e4d62e296c2579682d2cf11a29ada83c1323db (diff) | |
download | portage-a199763028a451389a92b8e58cab20cda83710b5.tar.gz portage-a199763028a451389a92b8e58cab20cda83710b5.tar.bz2 portage-a199763028a451389a92b8e58cab20cda83710b5.zip |
InheritEclass: avoid false positive in func regex
-rw-r--r-- | pym/repoman/checks.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 2864d675d..92a1e5a61 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -469,10 +469,11 @@ 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) - # 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') + # Match when the function is preceded only by leading whitespace, a + # shell operator such as (, {, |, ||, or &&, or optional variable + # setting(s). This prevents false postives in things like elog + # messages, as reported in bug #413285. + self._func_re = re.compile(r'(^|[|&{(])\s*(\w+=.*)?\b(' + '|'.join(funcs) + r')\b') def new(self, pkg): self.repoman_check_name = 'inherit.missing' @@ -496,7 +497,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(2), '%d') + (self._eclass, s.group(3), '%d') elif not self._func_call: self._func_call = self._func_re.search(line) |