summaryrefslogtreecommitdiffstats
path: root/pym/repoman
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-01-11 09:27:38 +0000
committerZac Medico <zmedico@gentoo.org>2008-01-11 09:27:38 +0000
commitaf2175f3af162eb903b997aec528130b4b56bb6b (patch)
treeae74287a8b41b5a2b6267a9a9a8361d0d71917fe /pym/repoman
parent6d98d4788348f34711420a8abcb62bb26d161871 (diff)
downloadportage-af2175f3af162eb903b997aec528130b4b56bb6b.tar.gz
portage-af2175f3af162eb903b997aec528130b4b56bb6b.tar.bz2
portage-af2175f3af162eb903b997aec528130b4b56bb6b.zip
Add a new "ebuild.autotools" check for when ebuilds call
autotools directly instead of using autotools.eclass. Thanks to Betelgeuse for the initial patch. svn path=/main/trunk/; revision=9179
Diffstat (limited to 'pym/repoman')
-rw-r--r--pym/repoman/checks.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 916003e7e..b4f1b016e 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -178,11 +178,25 @@ class EbuildUselessCdS(LineCheck):
elif self.method_re.match(line):
self.check_next_line = True
+class Autotools(LineCheck):
+ """Check for direct calls to autotools"""
+ repoman_check_name = 'ebuild.autotools'
+ re = re.compile(r'^[^#]*([^e]|^)(autoconf|automake|aclocal|libtoolize)')
+
+ 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 ("Direct calls to '%s'" % m.group(2)) + \
+ " instead of using autotools.eclass on line: %d"
+
+_constant_checks = tuple((c() for c in (Autotools,
+ EbuildWhitespace, EbuildQuote,
+ EbuildAssignment, EbuildUselessDodoc,
+ EbuildUselessCdS, EbuildNestedDie)))
+
def run_checks(contents, st_mtime):
- checks = []
- for c in (EbuildWhitespace, EbuildQuote, EbuildAssignment,
- EbuildUselessDodoc, EbuildUselessCdS, EbuildNestedDie):
- checks.append(c())
+ checks = list(_constant_checks)
checks.append(EbuildHeader(st_mtime))
for num, line in enumerate(contents):
for lc in checks: