Add a new upstream.workaround check for hardcoded MAKEOPTS=-j1 (previously
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 06:23:11 +0000 (06:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 06:23:11 +0000 (06:23 -0000)
only emake -j1 was recognized). Thanks to Maciej Mrozowski <reavertm@poczta.fm>
for this patch. (trunk r12718)

svn path=/main/branches/2.1.6/; revision=12973

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

index aee6d7c97e05be4bd7079d7b542ed1e756ae396d..5fc1c1a93528eb1315d7325d5fba6057d4281f3d 100644 (file)
@@ -322,6 +322,12 @@ class EMakeParallelDisabled(LineCheck):
        re = re.compile(r'^\s*emake\s+-j\s*1\s')
        error = errors.EMAKE_PARALLEL_DISABLED
 
+class EMakeParallelDisabledViaMAKEOPTS(LineCheck):
+       """Check for MAKEOPTS=-j1 that disables parallelization."""
+       repoman_check_name = 'upstream.workaround'
+       re = re.compile(r'^\s*MAKEOPTS=(\'|")?.*-j\s*1\b')
+       error = errors.EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS
+
 class DeprecatedBindnowFlags(LineCheck):
        """Check for calls to the deprecated bindnow-flags function."""
        repoman_check_name = 'ebuild.minorsyn'
@@ -354,8 +360,8 @@ _constant_checks = tuple((c() for c in (
        EbuildUselessCdS, EbuildNestedDie,
        EbuildPatches, EbuildQuotedA,
        IUseUndefined, ImplicitRuntimeDeps, InheritAutotools,
-       EMakeParallelDisabled, DeprecatedBindnowFlags,
-       WantAutoDefaultValue, PortageInternal)))
+       EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS,
+       DeprecatedBindnowFlags, WantAutoDefaultValue, PortageInternal)))
 
 def run_checks(contents, pkg):
        checks = _constant_checks
index 205913951214ba50e7b0c4f86cb71d46c2f291d4..451e499ad727f269ee03779803ca2c53221a36c4 100644 (file)
@@ -14,5 +14,6 @@ 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 = 'Upstream parallel compilation bug (ebuild calls emake -j1 on line: %d)'
+EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS = 'Upstream parallel compilation bug (MAKEOPTS=-j1 on line: %d)'
 DEPRECATED_BINDNOW_FLAGS = 'Deprecated bindnow-flags call on line: %d'
 PREPALLDOCS_ERROR = 'prepalldocs called on line: %d'