Remove an extra \$ from the EbuildQuote.var_reference regex
authorZac Medico <zmedico@gentoo.org>
Fri, 2 Nov 2007 07:30:30 +0000 (07:30 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 2 Nov 2007 07:30:30 +0000 (07:30 -0000)
so that it will properly match things like variable references
without braces, like $S. (trunk r8354)

Properly escape { and } characters in regular expressions even
though it seems to work either way. (trunk r8355)

svn path=/main/branches/2.1.2/; revision=8377

bin/repoman

index 84033318a098e87d5602282ad1d641d2b93415f2..f279900e344eb9526379f03145fb9a096c783e2a 100755 (executable)
@@ -760,10 +760,10 @@ class EbuildQuote(object):
        repoman_check_name = 'ebuild.minorsyn'
        ignore_line = re.compile(r'(^$)|(^\s*#.*)|(^\s*\w+=.*)|(^\s*(local|export)\s+)')
        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_reference = re.compile(r'\$(\{'+var_names+'\}|' + \
+               var_names + '\W)')
+       missing_quotes = re.compile(r'(\s|^)[^"\s]*\$\{?' + var_names + \
+               r'\}?[^"\s]*(\s|$)')
        cond_begin =  re.compile(r'(^|\s+)\[\[($|\\$|\s+)')
        cond_end =  re.compile(r'(^|\s+)\]\]($|\\$|\s+)')