Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13542 - in main/branches/2.1.6: bin man pym/repoman
Date: Thu, 30 Apr 2009 07:26:03
Message-Id: E1LzQee-0001mv-IT@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-04-30 07:26:00 +0000 (Thu, 30 Apr 2009)
3 New Revision: 13542
4
5 Modified:
6 main/branches/2.1.6/bin/repoman
7 main/branches/2.1.6/man/repoman.1
8 main/branches/2.1.6/pym/repoman/checks.py
9 main/branches/2.1.6/pym/repoman/errors.py
10 Log:
11 Add a new EAPI.definition check for cases in which EAPI is defined after an
12 inherit call. Thanks to Markus Meier <maekke@g.o> for the initial patch.
13 (trunk r13401)
14
15 Modified: main/branches/2.1.6/bin/repoman
16 ===================================================================
17 --- main/branches/2.1.6/bin/repoman 2009-04-30 07:24:48 UTC (rev 13541)
18 +++ main/branches/2.1.6/bin/repoman 2009-04-30 07:26:00 UTC (rev 13542)
19 @@ -266,6 +266,7 @@
20 "LICENSE.missing":"Ebuilds that have a missing or empty LICENSE variable",
21 "DESCRIPTION.missing":"Ebuilds that have a missing or empty DESCRIPTION variable",
22 "DESCRIPTION.toolong":"DESCRIPTION is over %d characters" % max_desc_len,
23 + "EAPI.definition":"EAPI is defined after an inherit call (must be defined before)",
24 "EAPI.incompatible":"Ebuilds that use features that are only available with a different EAPI",
25 "EAPI.unsupported":"Ebuilds that have an unsupported EAPI version (you must upgrade portage)",
26 "SLOT.missing":"Ebuilds that have a missing or empty SLOT variable",
27
28 Modified: main/branches/2.1.6/man/repoman.1
29 ===================================================================
30 --- main/branches/2.1.6/man/repoman.1 2009-04-30 07:24:48 UTC (rev 13541)
31 +++ main/branches/2.1.6/man/repoman.1 2009-04-30 07:26:00 UTC (rev 13542)
32 @@ -105,6 +105,9 @@
33 .B DESCRIPTION.missing
34 Ebuilds that have a missing or empty DESCRIPTION variable
35 .TP
36 +.B EAPI.definition
37 +EAPI is defined after an inherit call (must be defined before)
38 +.TP
39 .B EAPI.incompatible
40 Ebuilds that use features that are only available with a different EAPI
41 .TP
42
43 Modified: main/branches/2.1.6/pym/repoman/checks.py
44 ===================================================================
45 --- main/branches/2.1.6/pym/repoman/checks.py 2009-04-30 07:24:48 UTC (rev 13541)
46 +++ main/branches/2.1.6/pym/repoman/checks.py 2009-04-30 07:26:00 UTC (rev 13542)
47 @@ -213,6 +213,23 @@
48 elif self.method_re.match(line):
49 self.check_next_line = True
50
51 +class EapiDefinition(LineCheck):
52 + """ Check that EAPI is defined before inherits"""
53 + repoman_check_name = 'EAPI.definition'
54 +
55 + eapi_re = re.compile(r'^EAPI=')
56 + inherit_re = re.compile(r'^\s*inherit\s')
57 +
58 + def new(self, pkg):
59 + self.inherit_line = None
60 +
61 + def check(self, num, line):
62 + if self.eapi_re.match(line) is not None:
63 + if self.inherit_line is not None:
64 + return errors.EAPI_DEFINED_AFTER_INHERIT
65 + elif self.inherit_re.match(line) is not None:
66 + self.inherit_line = line
67 +
68 class EbuildPatches(LineCheck):
69 """Ensure ebuilds use bash arrays for PATCHES to ensure white space safety"""
70 repoman_check_name = 'ebuild.patches'
71 @@ -349,7 +366,7 @@
72 EbuildHeader, EbuildWhitespace, EbuildQuote,
73 EbuildAssignment, EbuildUselessDodoc,
74 EbuildUselessCdS, EbuildNestedDie,
75 - EbuildPatches, EbuildQuotedA,
76 + EbuildPatches, EbuildQuotedA, EapiDefinition,
77 IUseUndefined, ImplicitRuntimeDeps, InheritAutotools,
78 EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS,
79 DeprecatedBindnowFlags, WantAutoDefaultValue)))
80
81 Modified: main/branches/2.1.6/pym/repoman/errors.py
82 ===================================================================
83 --- main/branches/2.1.6/pym/repoman/errors.py 2009-04-30 07:24:48 UTC (rev 13541)
84 +++ main/branches/2.1.6/pym/repoman/errors.py 2009-04-30 07:26:00 UTC (rev 13542)
85 @@ -16,3 +16,4 @@
86 EMAKE_PARALLEL_DISABLED = 'Upstream parallel compilation bug (ebuild calls emake -j1 on line: %d)'
87 EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS = 'Upstream parallel compilation bug (MAKEOPTS=-j1 on line: %d)'
88 DEPRECATED_BINDNOW_FLAGS = 'Deprecated bindnow-flags call on line: %d'
89 +EAPI_DEFINED_AFTER_INHERIT = 'EAPI defined after inherit on line: %d'