commit: 6706dcc28a7cd120689664943802b64ea02ef685 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Sat Jul 15 01:07:59 2017 +0000 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> CommitDate: Sat Jul 15 02:25:45 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6706dcc2
repoman: New linechecks module, workaround .../modules/linechecks/workaround/__init__.py | 27 ++++++++++++++++++++++ .../modules/linechecks/workaround/workarounds.py | 18 +++++++++++++++ 2 files changed, 45 insertions(+) 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'