aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2017-07-15 01:00:30 +0000
committerZac Medico <zmedico@gentoo.org>2018-03-29 20:51:17 -0700
commitac1df05ac0d49c3c98518d77a892d2c18ad38195 (patch)
treef6750b4769124f9cecda2f6c3bf1606ff1eb709a
parentrepoman: New linechecks module, eapi (diff)
downloadportage-ac1df05ac0d49c3c98518d77a892d2c18ad38195.tar.gz
portage-ac1df05ac0d49c3c98518d77a892d2c18ad38195.tar.bz2
portage-ac1df05ac0d49c3c98518d77a892d2c18ad38195.zip
repoman: New linechecks module, emake
-rw-r--r--repoman/pym/repoman/modules/linechecks/emake/__init__.py27
-rw-r--r--repoman/pym/repoman/modules/linechecks/emake/emake.py23
2 files changed, 50 insertions, 0 deletions
diff --git a/repoman/pym/repoman/modules/linechecks/emake/__init__.py b/repoman/pym/repoman/modules/linechecks/emake/__init__.py
new file mode 100644
index 000000000..2e930dae8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/emake/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Emake plug-in module for repoman LineChecks.
+Performs emake checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+ 'name': 'do',
+ 'description': doc,
+ 'provides':{
+ 'paralleldisabled-check': {
+ 'name': "paralleldisabled",
+ 'sourcefile': "emake",
+ 'class': "EMakeParallelDisabledViaMAKEOPTS",
+ 'description': doc,
+ },
+ 'autodefault-check': {
+ 'name': "autodefault",
+ 'sourcefile': "emake",
+ 'class': "WantAutoDefaultValue",
+ 'description': doc,
+ },
+ }
+}
+
diff --git a/repoman/pym/repoman/modules/linechecks/emake/emake.py b/repoman/pym/repoman/modules/linechecks/emake/emake.py
new file mode 100644
index 000000000..e1e3e638e
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/emake/emake.py
@@ -0,0 +1,23 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+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 = 'EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS'
+
+
+class WantAutoDefaultValue(LineCheck):
+ """Check setting WANT_AUTO* to latest (default value)."""
+ repoman_check_name = 'ebuild.minorsyn'
+ _re = re.compile(r'^WANT_AUTO(CONF|MAKE)=(\'|")?latest')
+
+ def check(self, num, line):
+ m = self._re.match(line)
+ if m is not None:
+ return 'WANT_AUTO' + m.group(1) + \
+ ' redundantly set to default value "latest" on line: %d'