* [gentoo-java] repoman checks for generation 2
@ 2006-07-16 12:20 Krzysiek Pawlik
2006-07-16 12:33 ` Krzysiek Pawlik
0 siblings, 1 reply; 3+ messages in thread
From: Krzysiek Pawlik @ 2006-07-16 12:20 UTC (permalink / raw
To: Gentoo Java
[-- Attachment #1.1: Type: text/plain, Size: 355 bytes --]
Hi
I've added some checks to repoman for usage of generation 1 stuff in
ebuilds. Attached patch adds it. I'm contacting zmedico about adding it
to next version of portage. Any comments are welcome (more checks?).
--
Krzysiek Pawlik <nelchael at gentoo.org> key id: 0xBC555551
desktop-misc, desktop-dock, desktop-wm, x86, java, apache...
[-- Attachment #1.2: repoman-java-checks.diff --]
[-- Type: text/plain, Size: 1853 bytes --]
--- /usr/bin/repoman 2006-07-16 13:37:40.000000000 +0200
+++ repoman 2006-07-16 14:10:24.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,8 @@
continuation_symbol = re.compile(r'(.*[ ]+[\\][ ].*)')
line_continuation_quoted = re.compile(r'(\"|\')(([\w ,:;#\[\]\.`=/|\$\^\*{}()\'-])|(\\.))*\1')
line_continuation = re.compile(r'([^#]*\S)(\s+|\t)\\$')
+ ant_run = re.compile(r'^\s*ant')
+ had_and_run_warning=0
linenum=0
previous_line = None
for line in input(checkdir+"/"+y+".ebuild"):
@@ -1336,6 +1353,12 @@
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 = ant_run.match(line)
+ if match and not had_and_run_warning:
+ stats["usage.obsolete"] += 1
+ fails["usage.obsolete"].append(x+"/"+y+".ebuild: runs ant, should use java-ant-2 eclass")
+ had_and_run_warning=1
previous_line = line
del previous_line
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-java] repoman checks for generation 2
2006-07-16 12:20 [gentoo-java] repoman checks for generation 2 Krzysiek Pawlik
@ 2006-07-16 12:33 ` Krzysiek Pawlik
2006-07-16 15:51 ` Krzysiek Pawlik
0 siblings, 1 reply; 3+ messages in thread
From: Krzysiek Pawlik @ 2006-07-16 12:33 UTC (permalink / raw
To: Gentoo Java
[-- Attachment #1.1: Type: text/plain, Size: 429 bytes --]
Krzysiek Pawlik wrote:
> I've added some checks to repoman for usage of generation 1 stuff in
> ebuilds. Attached patch adds it. I'm contacting zmedico about adding it
> to next version of portage. Any comments are welcome (more checks?).
Blah... found a typo, attached version is fixed.
--
Krzysiek Pawlik <nelchael at gentoo.org> key id: 0xBC555551
desktop-misc, desktop-dock, desktop-wm, x86, java, apache...
[-- Attachment #1.2: repoman-java-checks.diff --]
[-- Type: text/plain, Size: 1853 bytes --]
--- /usr/bin/repoman 2006-07-16 13:37:40.000000000 +0200
+++ repoman 2006-07-16 14:32:13.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,8 @@
continuation_symbol = re.compile(r'(.*[ ]+[\\][ ].*)')
line_continuation_quoted = re.compile(r'(\"|\')(([\w ,:;#\[\]\.`=/|\$\^\*{}()\'-])|(\\.))*\1')
line_continuation = re.compile(r'([^#]*\S)(\s+|\t)\\$')
+ ant_run = re.compile(r'^\s*ant')
+ had_ant_run_warning=0
linenum=0
previous_line = None
for line in input(checkdir+"/"+y+".ebuild"):
@@ -1336,6 +1353,12 @@
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 = ant_run.match(line)
+ if match and not had_ant_run_warning:
+ stats["usage.obsolete"] += 1
+ fails["usage.obsolete"].append(x+"/"+y+".ebuild: runs ant, should use java-ant-2 eclass")
+ had_ant_run_warning=1
previous_line = line
del previous_line
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-java] repoman checks for generation 2
2006-07-16 12:33 ` Krzysiek Pawlik
@ 2006-07-16 15:51 ` Krzysiek Pawlik
0 siblings, 0 replies; 3+ messages in thread
From: Krzysiek Pawlik @ 2006-07-16 15:51 UTC (permalink / raw
To: Gentoo Java
[-- Attachment #1.1: Type: text/plain, Size: 191 bytes --]
This version has all checks from java-utils-2 eclass.
--
Krzysiek Pawlik <nelchael at gentoo.org> key id: 0xBC555551
desktop-misc, desktop-dock, desktop-wm, x86, java, apache...
[-- Attachment #1.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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-07-16 15:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-16 12:20 [gentoo-java] repoman checks for generation 2 Krzysiek Pawlik
2006-07-16 12:33 ` Krzysiek Pawlik
2006-07-16 15:51 ` Krzysiek Pawlik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox