summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-09 14:34:05 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-09 14:34:05 +0000
commitc5a1e0b212d8f5362177427dcad651269cb117b3 (patch)
treee694f2706a2befb2d0ac44bd3d2f51fca7909cf7
parentremove old/unused gen_wrapper function (trunk r10591) (diff)
downloadportage-multirepo-c5a1e0b212d8f5362177427dcad651269cb117b3.tar.gz
portage-multirepo-c5a1e0b212d8f5362177427dcad651269cb117b3.tar.bz2
portage-multirepo-c5a1e0b212d8f5362177427dcad651269cb117b3.zip
As suggested by Flameeyes, add a new 'inherit.autotools' check which warns
when autotools has been inherited but none of the eautomake, eautoconf or eautoreconf functions are called like they are supposed to be. (trunk r10592) svn path=/main/branches/2.1.2/; revision=10614
-rwxr-xr-xbin/repoman22
-rw-r--r--man/repoman.13
2 files changed, 20 insertions, 5 deletions
diff --git a/bin/repoman b/bin/repoman
index 0ebe79de..d1b5627b 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -168,6 +168,7 @@ qahelp={
"file.size":"Files in the files directory must be under 20k",
"file.name":"File/dir name must be composed of only the following chars: %s " % allowed_filename_chars,
"file.UTF8":"File is not UTF8 compliant",
+ "inherit.autotools":"Ebuild inherits autotools but does not call eautomake, eautoconf or eautoreconf",
"java.eclassesnotused":"With virtual/jdk in DEPEND you must inherit a java eclass",
"KEYWORDS.dropped":"Ebuilds that appear to have dropped KEYWORDS for some arch",
"KEYWORDS.missing":"Ebuilds that have a missing or empty KEYWORDS variable",
@@ -249,6 +250,7 @@ qawarnings=[
"ebuild.badheader",
"ebuild.patches",
"file.size",
+"inherit.autotools",
"java.eclassesnotused",
"metadata.missing",
"metadata.bad",
@@ -1109,12 +1111,20 @@ _constant_checks = tuple((c() for c in (
EbuildPatches, EbuildQuotedA)))
_iuse_def_re = re.compile(r'^IUSE=.*')
+_comment_re = re.compile(r'(^|\s*)#')
+_autotools_func_re = re.compile(r'(^|\s)(eautomake|eautoconf|eautoreconf)(\s|$)')
-def run_checks(contents):
+def run_checks(contents, inherited=None):
iuse_def = None
+ inherit_autotools = inherited and "autotools" in inherited
+ autotools_func_call = None
for num, line in enumerate(contents):
- if iuse_def is None:
- iuse_def = _iuse_def_re.match(line)
+ comment = _comment_re.match(line)
+ if comment is None:
+ if inherit_autotools and autotools_func_call is None:
+ autotools_func_call = _autotools_func_re.search(line)
+ if iuse_def is None:
+ iuse_def = _iuse_def_re.match(line)
for lc in _constant_checks:
ignore = lc.ignore_line
if not ignore or not ignore.match(line):
@@ -1123,6 +1133,8 @@ def run_checks(contents):
yield lc.repoman_check_name, e % (num + 1)
if iuse_def is None:
yield 'ebuild.minorsyn', 'IUSE is not defined'
+ if inherit_autotools and autotools_func_call is None:
+ yield 'inherit.autotools', 'no eauto* function called'
if mymode == "commit":
retval = ("","")
@@ -1530,7 +1542,7 @@ for x in scanlist:
myaux = ebuild_metadata[y]
eapi = myaux["EAPI"]
- inherited = myaux["INHERITED"].split()
+ inherited = frozenset(myaux["INHERITED"].split())
# Test for negative logic and bad words in the RESTRICT var.
#for x in myaux[allvars.index("RESTRICT")].split():
@@ -1831,7 +1843,7 @@ for x in scanlist:
f = open(full_path, 'rb')
try:
contents = f.readlines()
- for check_name, e in run_checks(contents):
+ for check_name, e in run_checks(contents, inherited=inherited):
stats[check_name] += 1
fails[check_name].append(relative_path + ': %s' % e)
finally:
diff --git a/man/repoman.1 b/man/repoman.1
index 0f83d638..0bf5ef34 100644
--- a/man/repoman.1
+++ b/man/repoman.1
@@ -262,6 +262,9 @@ Files in the files directory must be under 20k
.B filedir.missing
Package lacks a files directory
.TP
+.B inherit.autotools
+Ebuild inherits autotools but does not call eautomake, eautoconf or eautoreconf
+.TP
.B java.eclassesnotused
With virtual/jdk in DEPEND you must inherit a java eclass. Refer to
\fIhttp://www.gentoo.org/proj/en/java/java\-devel.xml\fR for more information.