1 |
commit: 30257d3c3d1762b3a2eaae20fbef2a48ceffa1c1 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jul 15 01:07:59 2017 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Mar 30 03:51:19 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=30257d3c |
7 |
|
8 |
repoman: New linechecks module, workaround |
9 |
|
10 |
.../modules/linechecks/workaround/__init__.py | 27 ++++++++++++++++++++++ |
11 |
.../modules/linechecks/workaround/workarounds.py | 18 +++++++++++++++ |
12 |
2 files changed, 45 insertions(+) |
13 |
|
14 |
diff --git a/repoman/pym/repoman/modules/linechecks/workaround/__init__.py b/repoman/pym/repoman/modules/linechecks/workaround/__init__.py |
15 |
new file mode 100644 |
16 |
index 000000000..0b5aa70c8 |
17 |
--- /dev/null |
18 |
+++ b/repoman/pym/repoman/modules/linechecks/workaround/__init__.py |
19 |
@@ -0,0 +1,27 @@ |
20 |
+# Copyright 2015-2016 Gentoo Foundation |
21 |
+# Distributed under the terms of the GNU General Public License v2 |
22 |
+ |
23 |
+doc = """Workaround plug-in module for repoman LineChecks. |
24 |
+Performs checks for upstream workarounds in ebuilds.""" |
25 |
+__doc__ = doc[:] |
26 |
+ |
27 |
+ |
28 |
+module_spec = { |
29 |
+ 'name': 'do', |
30 |
+ 'description': doc, |
31 |
+ 'provides':{ |
32 |
+ 'addpredict-check': { |
33 |
+ 'name': "addpredict", |
34 |
+ 'sourcefile': "workarounds", |
35 |
+ 'class': "SandboxAddpredict", |
36 |
+ 'description': doc, |
37 |
+ }, |
38 |
+ 'noasneeded-check': { |
39 |
+ 'name': "noasneeded", |
40 |
+ 'sourcefile': "workarounds", |
41 |
+ 'class': "NoAsNeeded", |
42 |
+ 'description': doc, |
43 |
+ }, |
44 |
+ } |
45 |
+} |
46 |
+ |
47 |
|
48 |
diff --git a/repoman/pym/repoman/modules/linechecks/workaround/workarounds.py b/repoman/pym/repoman/modules/linechecks/workaround/workarounds.py |
49 |
new file mode 100644 |
50 |
index 000000000..37cb54314 |
51 |
--- /dev/null |
52 |
+++ b/repoman/pym/repoman/modules/linechecks/workaround/workarounds.py |
53 |
@@ -0,0 +1,18 @@ |
54 |
+ |
55 |
+import re |
56 |
+ |
57 |
+from repoman.modules.linechecks.base import LineCheck |
58 |
+ |
59 |
+ |
60 |
+class NoAsNeeded(LineCheck): |
61 |
+ """Check for calls to the no-as-needed function.""" |
62 |
+ repoman_check_name = 'upstream.workaround' |
63 |
+ re = re.compile(r'.*\$\(no-as-needed\)') |
64 |
+ error = 'NO_AS_NEEDED' |
65 |
+ |
66 |
+ |
67 |
+class SandboxAddpredict(LineCheck): |
68 |
+ """Check for calls to the addpredict function.""" |
69 |
+ repoman_check_name = 'upstream.workaround' |
70 |
+ re = re.compile(r'(^|\s)addpredict\b') |
71 |
+ error = 'SANDBOX_ADDPREDICT' |