Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/linechecks/patches/
Date: Fri, 30 Mar 2018 04:23:45
Message-Id: 1522381878.ce7b5727490d7662a9402fb5c66e4b706443885e.zmedico@gentoo
1 commit: ce7b5727490d7662a9402fb5c66e4b706443885e
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 15 01:02:58 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 30 03:51:18 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ce7b5727
7
8 repoman: New linechecks module, patches
9
10 .../repoman/modules/linechecks/patches/__init__.py | 21 +++++++++++++++++++++
11 .../repoman/modules/linechecks/patches/patches.py | 16 ++++++++++++++++
12 2 files changed, 37 insertions(+)
13
14 diff --git a/repoman/pym/repoman/modules/linechecks/patches/__init__.py b/repoman/pym/repoman/modules/linechecks/patches/__init__.py
15 new file mode 100644
16 index 000000000..67434f911
17 --- /dev/null
18 +++ b/repoman/pym/repoman/modules/linechecks/patches/__init__.py
19 @@ -0,0 +1,21 @@
20 +# Copyright 2015-2016 Gentoo Foundation
21 +# Distributed under the terms of the GNU General Public License v2
22 +
23 +doc = """Patches plug-in module for repoman LineChecks.
24 +Performs PATCHES variable checks on ebuilds."""
25 +__doc__ = doc[:]
26 +
27 +
28 +module_spec = {
29 + 'name': 'do',
30 + 'description': doc,
31 + 'provides':{
32 + 'patches-check': {
33 + 'name': "patches",
34 + 'sourcefile': "patches",
35 + 'class': "EbuildPatches",
36 + 'description': doc,
37 + },
38 + }
39 +}
40 +
41
42 diff --git a/repoman/pym/repoman/modules/linechecks/patches/patches.py b/repoman/pym/repoman/modules/linechecks/patches/patches.py
43 new file mode 100644
44 index 000000000..63651cd7c
45 --- /dev/null
46 +++ b/repoman/pym/repoman/modules/linechecks/patches/patches.py
47 @@ -0,0 +1,16 @@
48 +
49 +
50 +import re
51 +
52 +from repoman.modules.linechecks.base import LineCheck
53 +
54 +
55 +class EbuildPatches(LineCheck):
56 + """Ensure ebuilds use bash arrays for PATCHES to ensure white space safety"""
57 + repoman_check_name = 'ebuild.patches'
58 + re = re.compile(r'^\s*PATCHES=[^\(]')
59 + error = 'PATCHES_ERROR'
60 +
61 + def check_eapi(self, eapi):
62 + return eapi in ("0", "1", "2", "3", "4", "4-python",
63 + "4-slot-abi", "5", "5-hdepend", "5-progress")