aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2017-07-15 01:07:59 +0000
committerZac Medico <zmedico@gentoo.org>2018-03-29 20:51:19 -0700
commit30257d3c3d1762b3a2eaae20fbef2a48ceffa1c1 (patch)
tree45d3b325df335824663fe6a7fad0d542208bcab1
parentrepoman: New linechecks module, whitespace (diff)
downloadportage-30257d3c3d1762b3a2eaae20fbef2a48ceffa1c1.tar.gz
portage-30257d3c3d1762b3a2eaae20fbef2a48ceffa1c1.tar.bz2
portage-30257d3c3d1762b3a2eaae20fbef2a48ceffa1c1.zip
repoman: New linechecks module, workaround
-rw-r--r--repoman/pym/repoman/modules/linechecks/workaround/__init__.py27
-rw-r--r--repoman/pym/repoman/modules/linechecks/workaround/workarounds.py18
2 files changed, 45 insertions, 0 deletions
diff --git a/repoman/pym/repoman/modules/linechecks/workaround/__init__.py b/repoman/pym/repoman/modules/linechecks/workaround/__init__.py
new file mode 100644
index 000000000..0b5aa70c8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/workaround/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Workaround plug-in module for repoman LineChecks.
+Performs checks for upstream workarounds in ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+ 'name': 'do',
+ 'description': doc,
+ 'provides':{
+ 'addpredict-check': {
+ 'name': "addpredict",
+ 'sourcefile': "workarounds",
+ 'class': "SandboxAddpredict",
+ 'description': doc,
+ },
+ 'noasneeded-check': {
+ 'name': "noasneeded",
+ 'sourcefile': "workarounds",
+ 'class': "NoAsNeeded",
+ 'description': doc,
+ },
+ }
+}
+
diff --git a/repoman/pym/repoman/modules/linechecks/workaround/workarounds.py b/repoman/pym/repoman/modules/linechecks/workaround/workarounds.py
new file mode 100644
index 000000000..37cb54314
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/workaround/workarounds.py
@@ -0,0 +1,18 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class NoAsNeeded(LineCheck):
+ """Check for calls to the no-as-needed function."""
+ repoman_check_name = 'upstream.workaround'
+ re = re.compile(r'.*\$\(no-as-needed\)')
+ error = 'NO_AS_NEEDED'
+
+
+class SandboxAddpredict(LineCheck):
+ """Check for calls to the addpredict function."""
+ repoman_check_name = 'upstream.workaround'
+ re = re.compile(r'(^|\s)addpredict\b')
+ error = 'SANDBOX_ADDPREDICT'