Add a new "java.eclassesnotused" check for cases where DEPEND contains
authorZac Medico <zmedico@gentoo.org>
Sat, 29 Mar 2008 06:54:53 +0000 (06:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 29 Mar 2008 06:54:53 +0000 (06:54 -0000)
virtual/jdk and and the appropriate java eclass has not been inherited
(a violation of the java team's policy). Thanks to Betelgeuse for the
initial patch. (trunk r9585)

svn path=/main/branches/2.1.2/; revision=9597

bin/repoman
man/repoman.1

index 38de132edba681deafb95f6ed9f2cbf5bb107321..48d3575922fb20af720692845b210be022c814bd 100755 (executable)
@@ -166,6 +166,7 @@ qahelp={
        "file.size":"Files in the files directory must be under 20k",
        "file.name":"File/dir name must be composed of only the following chars: %s " % allowed_filename_chars,
        "file.UTF8":"File is not UTF8 compliant",
+       "java.eclassesnotused":"With virtual/jdk in DEPEND you must inherit a java eclass",
        "KEYWORDS.dropped":"Ebuilds that appear to have dropped KEYWORDS for some arch",
        "KEYWORDS.missing":"Ebuilds that have a missing or empty KEYWORDS variable",
        "KEYWORDS.stable":"Ebuilds that have been added directly with stable KEYWORDS",
@@ -243,6 +244,7 @@ qawarnings=[
 "ebuild.minorsyn",
 "ebuild.badheader",
 "file.size",
+"java.eclassesnotused",
 "metadata.missing",
 "metadata.bad",
 "virtual.versioned",
@@ -1463,6 +1465,7 @@ for x in scanlist:
 
                myaux = ebuild_metadata[y]
                eapi = myaux["EAPI"]
+               inherited = myaux["INHERITED"].split()
 
                # Test for negative logic and bad words in the RESTRICT var.
                #for x in myaux[allvars.index("RESTRICT")].split():
@@ -1595,6 +1598,7 @@ for x in scanlist:
                                myflag = myflag[1:]
                        myiuse.add(myflag)
 
+               inherited_java_eclass = "java-pkg" in inherited
                operator_tokens = set(["||", "(", ")"])
                type_list, badsyntax = [], []
                for mytype in ("DEPEND", "RDEPEND", "PDEPEND", "LICENSE", "PROVIDE"):
@@ -1643,6 +1647,11 @@ for x in scanlist:
                                                badsyntax.append("'%s' not a valid atom" % token)
                                        else:
                                                atom = token.lstrip("!")
+                                               if mytype == "DEPEND" and \
+                                                       not inherited_java_eclass and \
+                                                       portage.dep_getkey(atom) == "virtual/jdk":
+                                                       stats['java.eclassesnotused'] += 1
+                                                       fails['java.eclassesnotused'].append(relative_path)
                                                if eapi == "0":
                                                        if portage_dep.dep_getslot(atom):
                                                                stats['EAPI.incompatible'] += 1
index 835d2e6255d4cd32d6ab68b5359a9c3b351f36f8..552640df4003e3e7994b2648baafe65bdd2ddf53 100644 (file)
@@ -256,6 +256,10 @@ Files in the files directory must be under 20k
 .B filedir.missing
 Package lacks a files directory
 .TP
+.B java.eclassesnotused
+With virtual/jdk in DEPEND you must inherit a java eclass. Refer to
+\fIhttp://www.gentoo.org/proj/en/java/java\-devel.xml\fR for more information.
+.TP
 .B metadata.bad
 Bad metadata.xml files
 .TP