Add a warning for emake -j1 calls which disable parallelization. Thanks to
authorZac Medico <zmedico@gentoo.org>
Sun, 31 Aug 2008 07:13:54 +0000 (07:13 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 31 Aug 2008 07:13:54 +0000 (07:13 -0000)
Diego "Flameeyes" Pettenò for the suggestion.

svn path=/main/trunk/; revision=11480

pym/repoman/checks.py
pym/repoman/errors.py

index 4b002568f74376b31b11db09cd86260290c14859..f7d7ce79d66e48914d332dfc01ff2b609b1181f2 100644 (file)
@@ -268,12 +268,19 @@ class IUseUndefined(LineCheck):
                if self._iuse_def is None:
                        yield 'IUSE is not defined'
 
+class EMakeParallelDisabled(LineCheck):
+       """Check for emake -j1 calls which disable parallelization."""
+       repoman_check_name = 'ebuild.minorsyn'
+       re = re.compile(r'^\s*emake\s*-j\s*1\s')
+       error = errors.EMAKE_PARALLEL_DISABLED
+
 _constant_checks = tuple((c() for c in (
        EbuildHeader, EbuildWhitespace, EbuildQuote,
        EbuildAssignment, EbuildUselessDodoc,
        EbuildUselessCdS, EbuildNestedDie,
        EbuildPatches, EbuildQuotedA,
-       IUseUndefined, InheritAutotools)))
+       IUseUndefined, InheritAutotools,
+       EMakeParallelDisabled)))
 
 def run_checks(contents, pkg):
        checks = _constant_checks
index 90fa83820295bba178dc2a480754d9f8dceb2484..c6577f945c3bb88670004eb000b074b521fd9ffa 100644 (file)
@@ -13,3 +13,4 @@ MISSING_QUOTES_ERROR = 'Unquoted Variable on line: %d'
 NESTED_DIE_ERROR = 'Ebuild calls die in a subshell on line: %d'
 PATCHES_ERROR = 'PATCHES is not a bash array on line: %d'
 REDUNDANT_CD_S_ERROR = 'Ebuild has redundant cd ${S} statement on line: %d'
+EMAKE_PARALLEL_DISABLED = 'Ebuild calls emake -j1 on line: %d'