From 4f6e99bee83928a1888284a8a8ec0295feffc6f5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 3 Oct 2007 00:12:18 +0000 Subject: [PATCH] In the EbuildQuote check, combine the var_assignment regex together with the ignore_line regex. This also fixes an issue with the var_assignment regex allowing violations like `make DESTDIR=${D}` to slip through. svn path=/main/trunk/; revision=7904 --- pym/repoman/checks.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index de7ceee23..d30785aed 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -118,13 +118,12 @@ class EbuildQuote(ContentCheck): """Ensure ebuilds have valid quoting around things like D,FILESDIR, etc...""" repoman_check_name = 'ebuild.minorsyn' - ignore_line = re.compile(r'(^$)|(^\s*#.*)') + ignore_line = re.compile(r'(^$)|(^\s*#.*)|(^\s*\w+=.*)') var_names = r'(D|S|T|ROOT|FILESDIR|WORKDIR)' var_reference = re.compile(r'\$({'+var_names+'}|' + \ r'\$' + var_names + '\W)') missing_quotes = re.compile(r'(\s|^)[^"\s]*\${?' + var_names + \ r'}?[^"\s]*(\s|$)') - var_assignment = re.compile(r'^\s*\w*=.*') cond_begin = re.compile(r'(^|\s+)\[\[($|\\$|\s+)') cond_end = re.compile(r'(^|\s+)\]\]($|\\$|\s+)') @@ -161,8 +160,6 @@ class EbuildQuote(ContentCheck): # get through the missing_quotes regex. if self.var_reference.search(group) is None: continue - if self.var_assignment.search(group) is not None: - continue # This is an attempt to avoid false positives without getting # too complex, while possibly allowing some (hopefully -- 2.26.2