summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-28 23:44:32 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-28 23:44:32 +0000
commit5ef910d80dd92fc6ae54eb0b996ee3e5c9555bc7 (patch)
treeb1386b319e1103183a07e9cf771462f45de69e85
parentBug #214691 - Move the "slot collision" display so that it is shown after (diff)
downloadportage-multirepo-5ef910d80dd92fc6ae54eb0b996ee3e5c9555bc7.tar.gz
portage-multirepo-5ef910d80dd92fc6ae54eb0b996ee3e5c9555bc7.tar.bz2
portage-multirepo-5ef910d80dd92fc6ae54eb0b996ee3e5c9555bc7.zip
Add a new "java.eclassesnotused" check for cases where DEPEND contains
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. svn path=/main/trunk/; revision=9585
-rwxr-xr-xbin/repoman9
-rw-r--r--man/repoman.14
2 files changed, 13 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman
index 08c3f192..4d7aa19c 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -250,6 +250,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",
@@ -326,6 +327,7 @@ qawarnings=[
"ebuild.minorsyn",
"ebuild.badheader",
"file.size",
+"java.eclassesnotused",
"metadata.missing",
"metadata.bad",
"virtual.versioned",
@@ -976,6 +978,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():
@@ -1108,6 +1111,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"):
@@ -1156,6 +1160,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
diff --git a/man/repoman.1 b/man/repoman.1
index f2175242..649356ac 100644
--- a/man/repoman.1
+++ b/man/repoman.1
@@ -238,6 +238,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