Check for quoted ${A}. Thanks to maekke for this patch.
authorZac Medico <zmedico@gentoo.org>
Fri, 18 Jan 2008 22:58:21 +0000 (22:58 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 18 Jan 2008 22:58:21 +0000 (22:58 -0000)
svn path=/main/trunk/; revision=9206

pym/repoman/checks.py

index b4f1b016e6d1a87b13693774a62ecaf43218b4a9..2c8d25e2f1405b71bbc4cbd12e5f65f8e77dbc66 100644 (file)
@@ -190,10 +190,21 @@ class Autotools(LineCheck):
                        return ("Direct calls to '%s'" % m.group(2)) + \
                                " instead of using autotools.eclass on line: %d"
 
+class EbuildQuotedA(LineCheck):
+       """Ensure ebuilds have no quoting around ${A}"""
+
+       repoman_check_name = 'ebuild.minorsyn'
+       a_quoted = re.compile(r'.*\"\$(\{A\}|A)\"')
+
+       def check(self, num, line):
+               match = self.a_quoted.match(line)
+               if match:
+                       return "Quoted \"${A}\" on line: %d"
+
 _constant_checks = tuple((c() for c in (Autotools,
        EbuildWhitespace, EbuildQuote,
        EbuildAssignment, EbuildUselessDodoc,
-       EbuildUselessCdS, EbuildNestedDie)))
+       EbuildUselessCdS, EbuildNestedDie, EbuildQuotedA)))
 
 def run_checks(contents, st_mtime):
        checks = list(_constant_checks)