From a8889947c45a9fa81ca006b333466372b64f0344 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 23 Apr 2012 13:15:56 -0700 Subject: [PATCH] repoman: fix portage.internal false positives --- pym/repoman/checks.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index ab4ddd9ec..733bbc3c1 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -664,13 +664,17 @@ class Eapi4GoneVars(LineCheck): class PortageInternal(LineCheck): repoman_check_name = 'portage.internal' - re = re.compile(r'[^#]*\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b') + ignore_comment = True + # Match when the command 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. + re = re.compile(r'^(\s*|.*[|&{(]+\s*)\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b') def check(self, num, line): """Run the check on line and return error if there is one""" m = self.re.match(line) if m is not None: - return ("'%s'" % m.group(1)) + " called on line: %d" + return ("'%s'" % m.group(2)) + " called on line: %d" _constant_checks = tuple((c() for c in ( EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote, -- 2.26.2