Bug #299095 - Add a deprecation warning for check_license calls with EAPI >= 3
authorZac Medico <zmedico@gentoo.org>
Mon, 22 Feb 2010 01:14:08 +0000 (01:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 22 Feb 2010 01:14:08 +0000 (01:14 -0000)
since it is superceded by LICENSE masking.

svn path=/main/trunk/; revision=15418

bin/repoman
man/repoman.1
pym/repoman/checks.py

index a67fae8dd1651a6fa5e9242d39cd8174fbfbff19..ba9feabcee9a209309f3dec435d8b82299adf181 100755 (executable)
@@ -288,6 +288,7 @@ qahelp={
        "DESCRIPTION.missing":"Ebuilds that have a missing or empty DESCRIPTION variable",
        "DESCRIPTION.toolong":"DESCRIPTION is over %d characters" % max_desc_len,
        "EAPI.definition":"EAPI is defined after an inherit call (must be defined before)",
+       "EAPI.deprecated":"Ebuilds that use features that are deprecated in the current EAPI",
        "EAPI.incompatible":"Ebuilds that use features that are only available with a different EAPI",
        "EAPI.unsupported":"Ebuilds that have an unsupported EAPI version (you must upgrade portage)",
        "SLOT.invalid":"Ebuilds that have a missing or invalid SLOT variable value",
@@ -368,6 +369,7 @@ qawarnings = set((
 "DEPEND.badmaskedindev","RDEPEND.badmaskedindev","PDEPEND.badmaskedindev",
 "DEPEND.badtilde", "RDEPEND.badtilde", "PDEPEND.badtilde",
 "DESCRIPTION.toolong",
+"EAPI.deprecated",
 "HOMEPAGE.virtual",
 "LICENSE.virtual",
 "KEYWORDS.dropped",
index 129ffd00bac4bbedb9c542e251449bba9d63b098..9d8f299d429dad62cb6ae7c4ddb515fec87c9dcf 100644 (file)
@@ -110,6 +110,9 @@ Ebuilds that have a missing or empty DESCRIPTION variable
 .B EAPI.definition
 EAPI is defined after an inherit call (must be defined before)
 .TP
+.B EAPI.deprecated
+Ebuilds that use features that are deprecated in the current EAPI
+.TP
 .B EAPI.incompatible
 Ebuilds that use features that are only available with a different EAPI
 .TP
index 36e074c9f129884a6a62a7762166f46cceabce46..941cb41889f98ab6bd2952a235a08b14badbb8cd 100644 (file)
@@ -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+)$')