diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-02-22 01:14:08 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-02-22 01:14:08 +0000 |
commit | da4d877173458a35778c9db93e0a8762c5cb1a6e (patch) | |
tree | c0a32a6b22787f5cb0bc3cfdac217ea139b83234 /pym/repoman | |
parent | Move the portage.FetchlistDict class to the portage.dbapi.porttree module. (diff) | |
download | portage-idfetch-da4d877173458a35778c9db93e0a8762c5cb1a6e.tar.gz portage-idfetch-da4d877173458a35778c9db93e0a8762c5cb1a6e.tar.bz2 portage-idfetch-da4d877173458a35778c9db93e0a8762c5cb1a6e.zip |
Bug #299095 - Add a deprecation warning for check_license calls with EAPI >= 3
since it is superceded by LICENSE masking.
svn path=/main/trunk/; revision=15418
Diffstat (limited to 'pym/repoman')
-rw-r--r-- | pym/repoman/checks.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 36e074c9..941cb418 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -438,6 +438,24 @@ class BuiltWithUse(LineCheck): re = re.compile('^.*built_with_use') error = errors.BUILT_WITH_USE +# EAPI-3 checks +class Eapi3DeprecatedFuncs(LineCheck): + repoman_check_name = 'EAPI.deprecated' + ignore_line = re.compile(r'(^\s*#)') + deprecated_commands_re = re.compile(r'^\s*(check_license)\b') + + def new(self, pkg): + self.eapi = pkg.metadata['EAPI'] + + def check_eapi(self, eapi): + return self.eapi not in ('0', '1', '2') + + def check(self, num, line): + m = self.deprecated_commands_re.match(line) + if m is not None: + return ("'%s'" % m.group(1)) + \ + " has been deprecated in EAPI=3 on line: %d" + # EAPI-4 checks class Eapi4IncompatibleFuncs(LineCheck): repoman_check_name = 'EAPI.incompatible' @@ -481,7 +499,8 @@ _constant_checks = tuple((c() for c in ( IUseUndefined, InheritAutotools, EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, NoAsNeeded, DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue, - SrcCompileEconf, Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse))) + SrcCompileEconf, Eapi3DeprecatedFuncs, + Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse))) _here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$') |