diff options
author | Sebastian Luther <SebastianLuther@gmx.de> | 2010-07-26 21:16:58 +0200 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-04 21:12:50 -0700 |
commit | b583812101f1156c553385effcd9dbee0b751087 (patch) | |
tree | afaba46337df1831c5bbf20dea2243f26b9da482 /pym | |
parent | Add a sanity check in _preload_portage_submodules() to ensure that the (diff) | |
download | portage-multirepo-b583812101f1156c553385effcd9dbee0b751087.tar.gz portage-multirepo-b583812101f1156c553385effcd9dbee0b751087.tar.bz2 portage-multirepo-b583812101f1156c553385effcd9dbee0b751087.zip |
repoman: Check if the prefix.eclass is inherited if eprefixify is used. Thanks to Jeremy Olexa (darkside) for the initial patch.
Diffstat (limited to 'pym')
-rw-r--r-- | pym/repoman/checks.py | 20 | ||||
-rw-r--r-- | pym/repoman/errors.py | 1 |
2 files changed, 20 insertions, 1 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index d403044b..5588fa86 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -306,6 +306,24 @@ class EbuildQuotedA(LineCheck): if match: return "Quoted \"${A}\" on line: %d" +class EprefixifyDefined(LineCheck): + """ Check that prefix.eclass is inherited if needed""" + + repoman_check_name = 'eprefixify.defined' + + _eprefixify_re = re.compile(r'\beprefixify\b') + _inherit_prefix_re = re.compile(r'^\s*inherit\s(.*\s)?prefix\b') + + def new(self, pkg): + self._prefix_inherited = False + + def check(self, num, line): + if self._eprefixify_re.search(line) is not None: + if not self._prefix_inherited: + return errors.EPREFIXIFY_MISSING_INHERIT + elif self._inherit_prefix_re.search(line) is not None: + self._prefix_inherited = True + class InheritAutotools(LineCheck): """ Make sure appropriate functions are called in @@ -493,7 +511,7 @@ _constant_checks = tuple((c() for c in ( EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote, EbuildAssignment, Eapi3EbuildAssignment, EbuildUselessDodoc, EbuildUselessCdS, EbuildNestedDie, - EbuildPatches, EbuildQuotedA, EapiDefinition, + EbuildPatches, EbuildQuotedA, EapiDefinition, EprefixifyDefined, IUseUndefined, InheritAutotools, EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, NoAsNeeded, DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue, diff --git a/pym/repoman/errors.py b/pym/repoman/errors.py index 97bd2829..8a28d4fd 100644 --- a/pym/repoman/errors.py +++ b/pym/repoman/errors.py @@ -19,3 +19,4 @@ EAPI_DEFINED_AFTER_INHERIT = 'EAPI defined after inherit on line: %d' NO_AS_NEEDED = 'Upstream asneeded linking bug (no-as-needed on line: %d)' PRESERVE_OLD_LIB = 'Upstream ABI change workaround on line: %d' BUILT_WITH_USE = 'built_with_use on line: %d' +EPREFIXIFY_MISSING_INHERIT = "prefix.eclass is not inherited, but eprefixify is used on line: %d" |