1 |
Author: zmedico |
2 |
Date: 2008-06-09 14:34:05 +0000 (Mon, 09 Jun 2008) |
3 |
New Revision: 10614 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/bin/repoman |
7 |
main/branches/2.1.2/man/repoman.1 |
8 |
Log: |
9 |
As suggested by Flameeyes, add a new 'inherit.autotools' check which warns |
10 |
when autotools has been inherited but none of the eautomake, eautoconf or |
11 |
eautoreconf functions are called like they are supposed to be. |
12 |
(trunk r10592) |
13 |
|
14 |
|
15 |
Modified: main/branches/2.1.2/bin/repoman |
16 |
=================================================================== |
17 |
--- main/branches/2.1.2/bin/repoman 2008-06-09 14:26:47 UTC (rev 10613) |
18 |
+++ main/branches/2.1.2/bin/repoman 2008-06-09 14:34:05 UTC (rev 10614) |
19 |
@@ -168,6 +168,7 @@ |
20 |
"file.size":"Files in the files directory must be under 20k", |
21 |
"file.name":"File/dir name must be composed of only the following chars: %s " % allowed_filename_chars, |
22 |
"file.UTF8":"File is not UTF8 compliant", |
23 |
+ "inherit.autotools":"Ebuild inherits autotools but does not call eautomake, eautoconf or eautoreconf", |
24 |
"java.eclassesnotused":"With virtual/jdk in DEPEND you must inherit a java eclass", |
25 |
"KEYWORDS.dropped":"Ebuilds that appear to have dropped KEYWORDS for some arch", |
26 |
"KEYWORDS.missing":"Ebuilds that have a missing or empty KEYWORDS variable", |
27 |
@@ -249,6 +250,7 @@ |
28 |
"ebuild.badheader", |
29 |
"ebuild.patches", |
30 |
"file.size", |
31 |
+"inherit.autotools", |
32 |
"java.eclassesnotused", |
33 |
"metadata.missing", |
34 |
"metadata.bad", |
35 |
@@ -1109,12 +1111,20 @@ |
36 |
EbuildPatches, EbuildQuotedA))) |
37 |
|
38 |
_iuse_def_re = re.compile(r'^IUSE=.*') |
39 |
+_comment_re = re.compile(r'(^|\s*)#') |
40 |
+_autotools_func_re = re.compile(r'(^|\s)(eautomake|eautoconf|eautoreconf)(\s|$)') |
41 |
|
42 |
-def run_checks(contents): |
43 |
+def run_checks(contents, inherited=None): |
44 |
iuse_def = None |
45 |
+ inherit_autotools = inherited and "autotools" in inherited |
46 |
+ autotools_func_call = None |
47 |
for num, line in enumerate(contents): |
48 |
- if iuse_def is None: |
49 |
- iuse_def = _iuse_def_re.match(line) |
50 |
+ comment = _comment_re.match(line) |
51 |
+ if comment is None: |
52 |
+ if inherit_autotools and autotools_func_call is None: |
53 |
+ autotools_func_call = _autotools_func_re.search(line) |
54 |
+ if iuse_def is None: |
55 |
+ iuse_def = _iuse_def_re.match(line) |
56 |
for lc in _constant_checks: |
57 |
ignore = lc.ignore_line |
58 |
if not ignore or not ignore.match(line): |
59 |
@@ -1123,6 +1133,8 @@ |
60 |
yield lc.repoman_check_name, e % (num + 1) |
61 |
if iuse_def is None: |
62 |
yield 'ebuild.minorsyn', 'IUSE is not defined' |
63 |
+ if inherit_autotools and autotools_func_call is None: |
64 |
+ yield 'inherit.autotools', 'no eauto* function called' |
65 |
|
66 |
if mymode == "commit": |
67 |
retval = ("","") |
68 |
@@ -1530,7 +1542,7 @@ |
69 |
|
70 |
myaux = ebuild_metadata[y] |
71 |
eapi = myaux["EAPI"] |
72 |
- inherited = myaux["INHERITED"].split() |
73 |
+ inherited = frozenset(myaux["INHERITED"].split()) |
74 |
|
75 |
# Test for negative logic and bad words in the RESTRICT var. |
76 |
#for x in myaux[allvars.index("RESTRICT")].split(): |
77 |
@@ -1831,7 +1843,7 @@ |
78 |
f = open(full_path, 'rb') |
79 |
try: |
80 |
contents = f.readlines() |
81 |
- for check_name, e in run_checks(contents): |
82 |
+ for check_name, e in run_checks(contents, inherited=inherited): |
83 |
stats[check_name] += 1 |
84 |
fails[check_name].append(relative_path + ': %s' % e) |
85 |
finally: |
86 |
|
87 |
Modified: main/branches/2.1.2/man/repoman.1 |
88 |
=================================================================== |
89 |
--- main/branches/2.1.2/man/repoman.1 2008-06-09 14:26:47 UTC (rev 10613) |
90 |
+++ main/branches/2.1.2/man/repoman.1 2008-06-09 14:34:05 UTC (rev 10614) |
91 |
@@ -262,6 +262,9 @@ |
92 |
.B filedir.missing |
93 |
Package lacks a files directory |
94 |
.TP |
95 |
+.B inherit.autotools |
96 |
+Ebuild inherits autotools but does not call eautomake, eautoconf or eautoreconf |
97 |
+.TP |
98 |
.B java.eclassesnotused |
99 |
With virtual/jdk in DEPEND you must inherit a java eclass. Refer to |
100 |
\fIhttp://www.gentoo.org/proj/en/java/java\-devel.xml\fR for more information. |
101 |
|
102 |
-- |
103 |
gentoo-commits@l.g.o mailing list |