repoman: add check for deprecated licenses, bug 440638
authorUlrich Müller <ulm@gentoo.org>
Wed, 31 Oct 2012 17:42:20 +0000 (18:42 +0100)
committerZac Medico <zmedico@gentoo.org>
Wed, 31 Oct 2012 21:30:35 +0000 (14:30 -0700)
bin/repoman
man/repoman.1

index 1502d6bb74f903eb2b251d4c1b2f707a8903a9ef..553b1d20f8164e7986f413ff403b7b770bcd8618 100755 (executable)
@@ -359,6 +359,7 @@ qahelp={
        "IUSE.invalid":"This ebuild has a variable in IUSE that is not in the use.desc or its metadata.xml file",
        "IUSE.missing":"This ebuild has a USE conditional which references a flag that is not listed in IUSE",
        "LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.",
+       "LICENSE.deprecated":"This ebuild is listing a deprecated license.",
        "KEYWORDS.invalid":"This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found",
        "RDEPEND.implicit":"RDEPEND is unset in the ebuild which triggers implicit RDEPEND=$DEPEND assignment (prior to EAPI 4)",
        "RDEPEND.suspect":"RDEPEND contains a package that usually only belongs in DEPEND.",
@@ -398,6 +399,7 @@ qawarnings = set((
 "DESCRIPTION.toolong",
 "EAPI.deprecated",
 "HOMEPAGE.virtual",
+"LICENSE.deprecated",
 "LICENSE.virtual",
 "KEYWORDS.dropped",
 "KEYWORDS.stupid",
@@ -922,6 +924,13 @@ for x in repoman_settings.archlist():
                print(red("up with the "+x+" team."))
                print()
 
+global_noiselimit = portage.util.noiselimit
+# Suppress error message if @DEPRECATED license group doesn't exist
+portage.util.noiselimit = -2
+liclist_deprecated = \
+       set(repoman_settings._license_manager.expandLicenseTokens(["@DEPRECATED"]))
+portage.util.noiselimit = global_noiselimit
+
 if not liclist:
        logging.fatal("Couldn't find licenses?")
        sys.exit(1)
@@ -2014,6 +2023,9 @@ for x in effective_scanlist:
                                if lic not in liclist and lic != "||":
                                        stats["LICENSE.invalid"]=stats["LICENSE.invalid"]+1
                                        fails["LICENSE.invalid"].append(x+"/"+y+".ebuild: %s" % lic)
+                               elif lic in liclist_deprecated:
+                                       stats["LICENSE.deprecated"] = stats["LICENSE.deprecated"] + 1
+                                       fails["LICENSE.deprecated"].append("%s: %s" % (relative_path, lic))
 
                #keyword checks
                myuse = myaux["KEYWORDS"].split()
index 6dd75e87dc82b88bd1e26f4f215f215ab255f519..e715f053219a2fc35df4322d6295ea05b4c06a5f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "REPOMAN" "1" "June 2012" "Portage VERSION" "Portage"
+.TH "REPOMAN" "1" "Oct 2012" "Portage VERSION" "Portage"
 .SH NAME
 repoman \- Gentoo's program to enforce a minimal level of quality assurance in packages added to the portage tree
 .SH SYNOPSIS
@@ -167,6 +167,9 @@ Ebuilds that have been added directly with stable KEYWORDS
 .B KEYWORDS.stupid
 Ebuilds that use KEYWORDS=-* instead of package.mask
 .TP
+.B LICENSE.deprecated
+This ebuild is listing a deprecated license.
+.TP
 .B LICENSE.invalid
 This ebuild is listing a license that doesnt exist in portages license/ dir.
 .TP