From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: gentoo-java@lists.gentoo.org
Subject: [gentoo-java] modular QA checks for repoman
Date: Sun, 23 Jul 2006 05:48:44 -0700 [thread overview]
Message-ID: <44C3702C.8050106@gentoo.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1519 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi everyone,
The Java team is trying to migrate all the Java ebuilds to the Generation 2 [1] system for building Java packages. They would like to have support included in repoman in order to help enforce the migration. Please see the attached patch that has been provided by nelchael. I'd like to help the Java team by including this functionality but I'd rather not mix the Java checks in with all the other generic ebuild checks. The only similar (special purpose) check that's currently included in repoman is the modular X deprecation check.
My plan is to create a framework for modular repoman checks, so that thinks like the Java and modular X checks can be cleanly separated. I haven't put much thought into it yet. I imagine that these modules will have the ability to operate on the ebuild metadata as well as the raw lines of ebuild text. They'll have to return the QA data somehow, perhaps by returning stats and fails dictionaries similar to those already used by repoman. Does anyone have ideas to share about the design of the framework? Since there aren't very many of these special purpose checks, should we just include them directly in repoman for now (vs. load them from external sources)?
Zac
[1] http://www.gentoo.org/proj/en/java/java-upgrade.xml
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)
iD8DBQFEw3Al/ejvha5XGaMRAmFDAJoCPx+3ZNrlEWYa+rek2x0mZ5bvcQCdFEtP
nrB7b/5CDMW/isZGD82thEQ=
=9exX
-----END PGP SIGNATURE-----
[-- Attachment #2: repoman-java-checks.diff --]
[-- Type: text/plain, Size: 2307 bytes --]
--- /usr/bin/repoman 2006-07-16 13:37:40.000000000 +0200
+++ repoman 2006-07-16 16:55:25.000000000 +0200
@@ -1051,6 +1051,21 @@
fails["LIVEVCS.stable"].append(x+"/"+y+".ebuild with stable keywords:%s " % bad_stable_keywords)
del keyword, bad_stable_keywords
+ """
+ Check for old style java eclasses
+ #1: old eclasses:
+ """
+ if set(["java-pkg","java-utils"]).intersection(myaux["INHERITED"].split()):
+ stats["usage.obsolete"] += 1
+ fails["usage.obsolete"].append("%s/%s.ebuild: not migrated to generation 2 of java system" % (x, y))
+
+ """
+ #2: not needed USE flags:
+ """
+ if set(["jikes"]).intersection(myaux["IUSE"].split()):
+ stats["usage.obsolete"] += 1
+ fails["usage.obsolete"].append("%s/%s.ebuild: has jikes in IUSE" % (x, y))
+
if "--ignore-arches" in myoptions:
arches = [[repoman_settings["ARCH"], repoman_settings["ARCH"],
repoman_settings["ACCEPT_KEYWORDS"].split()]]
@@ -1268,6 +1283,10 @@
continuation_symbol = re.compile(r'(.*[ ]+[\\][ ].*)')
line_continuation_quoted = re.compile(r'(\"|\')(([\w ,:;#\[\]\.`=/|\$\^\*{}()\'-])|(\\.))*\1')
line_continuation = re.compile(r'([^#]*\S)(\s+|\t)\\$')
+ java_ant_run = re.compile(r'^\s*ant')
+ java_source = re.compile(r'.*java-pkg_dosrc.*')
+ java_had_ant_run_warning=0
+ java_had_source_warning=0
linenum=0
previous_line = None
for line in input(checkdir+"/"+y+".ebuild"):
@@ -1336,6 +1355,18 @@
myerrormsg = "Line continuation (\"\\\") Syntax Error. Line %d" % linenum
stats["ebuild.majorsyn"] +=1
fails["ebuild.majorsyn"].append(x+"/"+y+".ebuild: %s" % myerrormsg)
+ # ant usage check
+ match = java_ant_run.match(line)
+ if match and not java_had_ant_run_warning:
+ stats["usage.obsolete"] += 1
+ fails["usage.obsolete"].append(x+"/"+y+".ebuild: runs ant, should use java-ant-2 eclass")
+ java_had_ant_run_warning=1
+ # java-pkg_dosrc without IUSE="source"
+ match = java_source.match(line)
+ if match and not java_had_source_warning and 'source' not in myaux['IUSE'].split():
+ stats["ebuild.minorsyn"] += 1
+ fails["ebuild.minorsyn"].append(x+"/"+y+".ebuild: uses java-pkg_dosrc, but lacks source in IUSE")
+ java_had_source_warning=1
previous_line = line
del previous_line
reply other threads:[~2006-07-23 12:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44C3702C.8050106@gentoo.org \
--to=zmedico@gentoo.org \
--cc=gentoo-java@lists.gentoo.org \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox