diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-10-03 00:12:18 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-10-03 00:12:18 +0000 |
commit | 4f6e99bee83928a1888284a8a8ec0295feffc6f5 (patch) | |
tree | 2d3aa649903c01a03a3d4e788b0de207899e6d78 | |
parent | cf1d139137a6fa898384665515f4992c5934801f (diff) | |
download | portage-4f6e99bee83928a1888284a8a8ec0295feffc6f5.tar.gz portage-4f6e99bee83928a1888284a8a8ec0295feffc6f5.tar.bz2 portage-4f6e99bee83928a1888284a8a8ec0295feffc6f5.zip |
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
-rw-r--r-- | pym/repoman/checks.py | 5 |
1 files changed, 1 insertions, 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 |