aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2017-07-15 01:02:58 +0000
committerZac Medico <zmedico@gentoo.org>2018-03-29 20:51:18 -0700
commitce7b5727490d7662a9402fb5c66e4b706443885e (patch)
tree84b3827697f5928d01dc34632971fe0bc58ffb54
parentrepoman: New linechecks module, nested (diff)
downloadportage-ce7b5727490d7662a9402fb5c66e4b706443885e.tar.gz
portage-ce7b5727490d7662a9402fb5c66e4b706443885e.tar.bz2
portage-ce7b5727490d7662a9402fb5c66e4b706443885e.zip
repoman: New linechecks module, patches
-rw-r--r--repoman/pym/repoman/modules/linechecks/patches/__init__.py21
-rw-r--r--repoman/pym/repoman/modules/linechecks/patches/patches.py16
2 files changed, 37 insertions, 0 deletions
diff --git a/repoman/pym/repoman/modules/linechecks/patches/__init__.py b/repoman/pym/repoman/modules/linechecks/patches/__init__.py
new file mode 100644
index 000000000..67434f911
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/patches/__init__.py
@@ -0,0 +1,21 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Patches plug-in module for repoman LineChecks.
+Performs PATCHES variable checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+ 'name': 'do',
+ 'description': doc,
+ 'provides':{
+ 'patches-check': {
+ 'name': "patches",
+ 'sourcefile': "patches",
+ 'class': "EbuildPatches",
+ 'description': doc,
+ },
+ }
+}
+
diff --git a/repoman/pym/repoman/modules/linechecks/patches/patches.py b/repoman/pym/repoman/modules/linechecks/patches/patches.py
new file mode 100644
index 000000000..63651cd7c
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/patches/patches.py
@@ -0,0 +1,16 @@
+
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildPatches(LineCheck):
+ """Ensure ebuilds use bash arrays for PATCHES to ensure white space safety"""
+ repoman_check_name = 'ebuild.patches'
+ re = re.compile(r'^\s*PATCHES=[^\(]')
+ error = 'PATCHES_ERROR'
+
+ def check_eapi(self, eapi):
+ return eapi in ("0", "1", "2", "3", "4", "4-python",
+ "4-slot-abi", "5", "5-hdepend", "5-progress")