* [gentoo-java] Falling to the lowest jdk available
@ 2006-07-28 9:09 Miroslav Šulc
2006-07-28 9:24 ` Krzysiek Pawlik
2006-07-28 9:31 ` Caster
0 siblings, 2 replies; 16+ messages in thread
From: Miroslav Šulc @ 2006-07-28 9:09 UTC (permalink / raw
To: Gentoo Java
[-- Attachment #1: Type: text/plain, Size: 3519 bytes --]
Hi,
I've faced a problem with migrated packages on my laptop. If I remember
well, I've read somewhere that the new Java system will always try to
build packages with the lower JDK possible. At least on my laptop (it's
a fresh install of Gentoo - I've installed it about two weeks ago)
packages are not built with the lowest JDK possible which results in
these bugs when compiling packages dependant on a badly built package:
>>> Emerging (1 of 1) dev-java/xerces-2.7.1-r1 to /
* checking ebuild checksums ;-)
...
[ ok ]
* checking auxfile checksums ;-)
...
[ ok ]
* checking miscfile checksums ;-)
...
[ ok ]
* checking Xerces-J-src.2.7.1.tar.gz ;-)
...
[ ok ]
* Using: sun-jdk-1.4
>>> Unpacking source...
>>> Unpacking Xerces-J-src.2.7.1.tar.gz to
/var/tmp/portage/xerces-2.7.1-r1/work
tar: A lone zero block at 19079
* Applying xerces-2.7.1-r1-gentoo.patch
...
[ ok ]
* Applying xerces-2.7.1-no_dom3.patch
...
[ ok ]
>>> Source unpacked.
Rewriting ./build.xml
>>> Compiling source in
/var/tmp/portage/xerces-2.7.1-r1/work/xerces-2_7_1 ...
Buildfile: build.xml
BUILD FAILED
java.lang.UnsupportedClassVersionError: org/xml/sax/ext/Attributes2
(Unsupported major.minor version 49.0)
...
In this example dev-java/xml-commons-external was built using JDK 1.5
though it could be built JDK 1.4 too.
>>> Emerging (1 of 1) dev-java/xml-commons-external-1.3.02-r1 to /
* checking ebuild checksums ;-)
...
[ ok ]
* checking auxfile checksums ;-)
...
[ ok ]
* checking miscfile checksums ;-)
...
[ ok ]
* checking xml-commons-external-1.3.02.tar.bz2 ;-)
...
[ ok ]
* Using: sun-jdk-1.5
>>> Unpacking source...
>>> Unpacking xml-commons-external-1.3.02.tar.bz2 to
/var/tmp/portage/xml-commons-external-1.3.02-r1/work
>>> Source unpacked.
Rewriting ./build.xml
...
>From ebuild:
...
DEPEND=">=virtual/jdk-1.3
dev-java/ant-core"
RDEPEND=">=virtual/jre-1.3"
...
Am I missing something or is there a bug?
Miroslav
[-- Attachment #2: miroslav.sulc.vcf --]
[-- Type: text/x-vcard, Size: 349 bytes --]
begin:vcard
fn;quoted-printable:Miroslav =C5=A0ulc
n;quoted-printable:=C5=A0ulc;Miroslav
org:StartNet s.r.o.
adr;quoted-printable;quoted-printable:;;Schodov=C3=A1 309/10;Praha 5;;150 00;=C4=8Cesk=C3=A1 republika
email;internet:miroslav.sulc@startnet.cz
tel;cell:+420 603 711 413
x-mozilla-html:TRUE
url:http://www.startnet.cz
version:2.1
end:vcard
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 9:09 [gentoo-java] Falling to the lowest jdk available Miroslav Šulc
@ 2006-07-28 9:24 ` Krzysiek Pawlik
2006-07-28 10:33 ` Miroslav Šulc
2006-07-28 9:31 ` Caster
1 sibling, 1 reply; 16+ messages in thread
From: Krzysiek Pawlik @ 2006-07-28 9:24 UTC (permalink / raw
To: gentoo-java; +Cc: Miroslav Šulc
[-- Attachment #1: Type: text/plain, Size: 666 bytes --]
Miroslav Šulc wrote:
> Hi,
>
> I've faced a problem with migrated packages on my laptop. If I remember
> well, I've read somewhere that the new Java system will always try to
> build packages with the lower JDK possible. At least on my laptop (it's
> a fresh install of Gentoo - I've installed it about two weeks ago)
> packages are not built with the lowest JDK possible which results in
> these bugs when compiling packages dependant on a badly built package:
Lowest "-target/-source", not JDK! Run java-1.5-fixer
--
Krzysiek Pawlik <nelchael at gentoo.org> key id: 0xBC555551
desktop-misc, desktop-dock, desktop-wm, x86, java, apache...
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 9:09 [gentoo-java] Falling to the lowest jdk available Miroslav Šulc
2006-07-28 9:24 ` Krzysiek Pawlik
@ 2006-07-28 9:31 ` Caster
2006-07-28 10:40 ` Miroslav Šulc
1 sibling, 1 reply; 16+ messages in thread
From: Caster @ 2006-07-28 9:31 UTC (permalink / raw
To: gentoo-java
Miroslav Šulc wrote:
> Hi,
>
> I've faced a problem with migrated packages on my laptop. If I remember
> well, I've read somewhere that the new Java system will always try to
> build packages with the lower JDK possible. At least on my laptop (it's
> a fresh install of Gentoo - I've installed it about two weeks ago)
> packages are not built with the lowest JDK possible which results in
> these bugs when compiling packages dependant on a badly built package:
It's like this:
DEPEND=">=virtual/jdk-1.4" will make it use 1.4 or higher JDK (it
prefers the higher, you can tune that in
/etc/java-config-2/build/jdk.conf) but it will rewrite the build.xml
file(s) to -source 1.4 -target 1.4 so even with 1.5 JDK it should
produce 1.4 compatible class files.
DEPEND="=virtual/jdk-1.4" will use 1.4 JDK specifically, in case the
package needs not just 1.4 language compliance but e.g. also breaks on
1.4 -> 1.5 API changes or relies on something else that is specific only
to 1.4.
So seeing "Using: sun-jdk-1.5" is not a bug, note you also see the
"Rewriting ./build.xml" that ensures proper -source and -target
arguments. The problem could be if you have built something with 1.5
before the migration - run java-1.5-fixer to fix that. But it is also
possible that the build.xml file(s) weren't properly rewritten, some
were ommitted... and that would be a bug. You just need to find out
which package is causing that (probably some that will want to be
rebuilt with java-1.5-fixer over and over again).
Caster
--
gentoo-java@gentoo.org mailing list
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 9:24 ` Krzysiek Pawlik
@ 2006-07-28 10:33 ` Miroslav Šulc
2006-07-28 10:43 ` Krzysiek Pawlik
2006-07-28 10:44 ` Caster
0 siblings, 2 replies; 16+ messages in thread
From: Miroslav Šulc @ 2006-07-28 10:33 UTC (permalink / raw
Cc: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 5346 bytes --]
Krzysiek Pawlik napsal(a):
> Miroslav Šulc wrote:
>
>> Hi,
>>
>> I've faced a problem with migrated packages on my laptop. If I remember
>> well, I've read somewhere that the new Java system will always try to
>> build packages with the lower JDK possible. At least on my laptop (it's
>> a fresh install of Gentoo - I've installed it about two weeks ago)
>> packages are not built with the lowest JDK possible which results in
>> these bugs when compiling packages dependant on a badly built package:
>>
>
> Lowest "-target/-source", not JDK! Run java-1.5-fixer
>
I don't remember that I would do something that would broke the building
of Java packages (I have a fresh install) but the fixer really fixed
that. Thank you :-)
But still my system is not clean. Running java-1.5-fixer after that
several times gives me this:
# java-1.5-fixer
* Generating a list of jars which ant uses
...
[ ok ]
* Checking for > 1.4 bytecode in ant jars
...
[ ok ]
* Generating a list of jars in the system
...
[ ok ]
* Checking for > 1.4 bytecode in system jars
...
[ ok ]
* Attempting to fix broken packages ...
* Packages to fix this run:
=dev-java/aspectwerkz-2.0_rc2-r1 =dev-java/aspectwerkz-2.0_rc2-r1
=dev-java/aspectwerkz-2.0_rc2-r1 =dev-java/aspectwerkz-2.0_rc2-r1
=dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
=dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
=dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
=dev-util/subversion-1.3.2-r3
And when trying to build dom4j I get this:
>>> Emerging (1 of 1) dev-java/dom4j-1.6.1-r1 to /
* checking ebuild checksums ;-)
...
[ ok ]
* checking auxfile checksums ;-)
...
[ ok ]
* checking miscfile checksums ;-)
...
[ ok ]
* checking dom4j-1.6.1.tar.gz ;-)
...
[ ok ]
* Using: sun-jdk-1.4
>>> Unpacking source...
>>> Unpacking dom4j-1.6.1.tar.gz to /var/tmp/portage/dom4j-1.6.1-r1/work
tar: A lone zero block at 78061
>>> Source unpacked.
Rewriting ./build.xml
>>> Compiling source in /var/tmp/portage/dom4j-1.6.1-r1/work/dom4j-1.6.1 ...
Buildfile: build.xml
init:
[echo] ----------- dom4j 1.6.1 [2005] ------------
clean:
init:
[echo] ----------- dom4j 1.6.1 [2005] ------------
prepare:
[mkdir] Created dir:
/var/tmp/portage/dom4j-1.6.1-r1/work/dom4j-1.6.1/build
prepare-src:
[mkdir] Created dir:
/var/tmp/portage/dom4j-1.6.1-r1/work/dom4j-1.6.1/build/src
[mkdir] Created dir:
/var/tmp/portage/dom4j-1.6.1-r1/work/dom4j-1.6.1/build/classes
[copy] Copying 179 files to
/var/tmp/portage/dom4j-1.6.1-r1/work/dom4j-1.6.1/build/src
compile:
[javac] Compiling 166 source files to
/var/tmp/portage/dom4j-1.6.1-r1/work/dom4j-1.6.1/build/classes
[javac]
/var/tmp/portage/dom4j-1.6.1-r1/work/dom4j-1.6.1/build/src/org/dom4j/jaxb/JAXBSupport.java:12:
cannot access javax.xml.bind.JAXBContext
[javac] bad class file:
/var/tmp/portage/dom4j-1.6.1-r1/work/dom4j-1.6.1/lib/jaxmeapi.jar(javax/xml/bind/JAXBContext.class)
[javac] class file has wrong version 49.0, should be 48.0
[javac] Please remove or make sure it appears in the correct
subdirectory of the classpath.
[javac] import javax.xml.bind.JAXBContext;
[javac] ^
[javac] 1 error
BUILD FAILED
/var/tmp/portage/dom4j-1.6.1-r1/work/dom4j-1.6.1/build.xml:142: Compile
failed; see the compiler error output for details.
Total time: 3 seconds
!!! ERROR: dev-java/dom4j-1.6.1-r1 failed.
Call stack:
ebuild.sh, line 1545: Called dyn_compile
ebuild.sh, line 940: Called src_compile
dom4j-1.6.1-r1.ebuild, line 68: Called eant 'clean' 'package'
java-utils-2.eclass, line 1224: Called die
!!! eant failed
!!! If you need support, post the topmost build error, and the call
stack if relevant.
!!! When you file a bug report, please include the following information:
GENTOO_VM=sun-jdk-1.4 CLASSPATH="" JAVA_HOME="/opt/sun-jdk-1.4.2.12"
JAVACFLAGS="-source 1.3 -target 1.3" COMPILER="javac"
and of course, the output of emerge --info
Miroslav
[-- Attachment #2: miroslav.sulc.vcf --]
[-- Type: text/x-vcard, Size: 361 bytes --]
begin:vcard
fn;quoted-printable:Miroslav =C5=A0ulc
n;quoted-printable:=C5=A0ulc;Miroslav
org:StartNet s.r.o.
adr;quoted-printable;quoted-printable:;;Schodov=C3=A1 309/10;Praha 5;;150 00;=C4=8Cesk=C3=A1 republika
email;internet:miroslav.sulc@startnet.cz
tel;cell:+420 603 711 413
x-mozilla-html:TRUE
url:http://www.startnet.cz
version:2.1
end:vcard
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 9:31 ` Caster
@ 2006-07-28 10:40 ` Miroslav Šulc
2006-07-28 10:54 ` Wiktor Wandachowicz
0 siblings, 1 reply; 16+ messages in thread
From: Miroslav Šulc @ 2006-07-28 10:40 UTC (permalink / raw
To: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 3041 bytes --]
Caster napsal(a):
> Miroslav Šulc wrote:
>
>> Hi,
>>
>> I've faced a problem with migrated packages on my laptop. If I remember
>> well, I've read somewhere that the new Java system will always try to
>> build packages with the lower JDK possible. At least on my laptop (it's
>> a fresh install of Gentoo - I've installed it about two weeks ago)
>> packages are not built with the lowest JDK possible which results in
>> these bugs when compiling packages dependant on a badly built package:
>>
>
> It's like this:
>
> DEPEND=">=virtual/jdk-1.4" will make it use 1.4 or higher JDK (it
> prefers the higher, you can tune that in
> /etc/java-config-2/build/jdk.conf) but it will rewrite the build.xml
> file(s) to -source 1.4 -target 1.4 so even with 1.5 JDK it should
> produce 1.4 compatible class files.
>
> DEPEND="=virtual/jdk-1.4" will use 1.4 JDK specifically, in case the
> package needs not just 1.4 language compliance but e.g. also breaks on
> 1.4 -> 1.5 API changes or relies on something else that is specific only
> to 1.4.
>
> So seeing "Using: sun-jdk-1.5" is not a bug, note you also see the
> "Rewriting ./build.xml" that ensures proper -source and -target
> arguments. The problem could be if you have built something with 1.5
> before the migration - run java-1.5-fixer to fix that. But it is also
> possible that the build.xml file(s) weren't properly rewritten, some
> were ommitted... and that would be a bug. You just need to find out
> which package is causing that (probably some that will want to be
> rebuilt with java-1.5-fixer over and over again).
>
Thank you for explanation. Now it's clear to me. I've discovered that
jaxme, aspectwerkz and subversion want to be rebuild over and over again:
# java-1.5-fixer
* Generating a list of jars which ant uses
...
[ ok ]
* Checking for > 1.4 bytecode in ant jars
...
[ ok ]
* Generating a list of jars in the system
...
[ ok ]
* Checking for > 1.4 bytecode in system jars
...
[ ok ]
* Attempting to fix broken packages ...
* Packages to fix this run:
=dev-java/aspectwerkz-2.0_rc2-r1 =dev-java/aspectwerkz-2.0_rc2-r1
=dev-java/aspectwerkz-2.0_rc2-r1 =dev-java/aspectwerkz-2.0_rc2-r1
=dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
=dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
=dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
=dev-util/subversion-1.3.2-r3
> Caster
>
[-- Attachment #2: miroslav.sulc.vcf --]
[-- Type: text/x-vcard, Size: 349 bytes --]
begin:vcard
fn;quoted-printable:Miroslav =C5=A0ulc
n;quoted-printable:=C5=A0ulc;Miroslav
org:StartNet s.r.o.
adr;quoted-printable;quoted-printable:;;Schodov=C3=A1 309/10;Praha 5;;150 00;=C4=8Cesk=C3=A1 republika
email;internet:miroslav.sulc@startnet.cz
tel;cell:+420 603 711 413
x-mozilla-html:TRUE
url:http://www.startnet.cz
version:2.1
end:vcard
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 10:33 ` Miroslav Šulc
@ 2006-07-28 10:43 ` Krzysiek Pawlik
2006-07-28 11:01 ` Caster
2006-07-28 10:44 ` Caster
1 sibling, 1 reply; 16+ messages in thread
From: Krzysiek Pawlik @ 2006-07-28 10:43 UTC (permalink / raw
To: Miroslav Šulc; +Cc: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 606 bytes --]
Miroslav Šulc wrote:
> =dev-java/aspectwerkz-2.0_rc2-r1 =dev-java/aspectwerkz-2.0_rc2-r1
> =dev-java/aspectwerkz-2.0_rc2-r1 =dev-java/aspectwerkz-2.0_rc2-r1
> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
> =dev-util/subversion-1.3.2-r3
Please merge jaxme again after sync - I've fixed a bug in it.
aspectwerkz requires 1.5 - dunno about subversion.
--
Krzysiek Pawlik <nelchael at gentoo.org> key id: 0xBC555551
desktop-misc, desktop-dock, desktop-wm, x86, java, apache...
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 10:33 ` Miroslav Šulc
2006-07-28 10:43 ` Krzysiek Pawlik
@ 2006-07-28 10:44 ` Caster
1 sibling, 0 replies; 16+ messages in thread
From: Caster @ 2006-07-28 10:44 UTC (permalink / raw
To: gentoo-java
Miroslav Šulc wrote:
> =dev-java/aspectwerkz-2.0_rc2-r1 =dev-java/aspectwerkz-2.0_rc2-r1
> =dev-java/aspectwerkz-2.0_rc2-r1 =dev-java/aspectwerkz-2.0_rc2-r1
> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
An user reported same problem with dom4j leading to jaxme on
#gentoo-java yesterday. Seems that not all build*.xml files are
rewritten there. File a bug report. aspectwerks could be the same
problem - another bug report.
> =dev-util/subversion-1.3.2-r3
I'm filling a bug report for that already, it's caused by a small typo :)
Caster
--
gentoo-java@gentoo.org mailing list
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 10:40 ` Miroslav Šulc
@ 2006-07-28 10:54 ` Wiktor Wandachowicz
2006-07-28 11:26 ` Miroslav Šulc
0 siblings, 1 reply; 16+ messages in thread
From: Wiktor Wandachowicz @ 2006-07-28 10:54 UTC (permalink / raw
To: gentoo-java
06-07-28, Miroslav Šulc wrote:
> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
This one is already fixed, see:
http://bugs.gentoo.org/show_bug.cgi?id=141940
Do:
# emerge --sync
# emerge -avC jaxme
and proceed as usual. Alternatively add the third step:
# emerge -av1 jaxme
Good luck and search the Bugzilla more often ;)
Wiktor
--
Registered Linux user #390131 (http://counter.li.org)
--
gentoo-java@gentoo.org mailing list
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 10:43 ` Krzysiek Pawlik
@ 2006-07-28 11:01 ` Caster
2006-07-28 11:12 ` Krzysiek Pawlik
2006-07-28 11:59 ` Caster
0 siblings, 2 replies; 16+ messages in thread
From: Caster @ 2006-07-28 11:01 UTC (permalink / raw
To: gentoo-java
Krzysiek Pawlik wrote:
> Miroslav Šulc wrote:
>
> Please merge jaxme again after sync - I've fixed a bug in it.
> aspectwerkz requires 1.5 - dunno about subversion.
>
Why not revbump jaxme so people will get the fix before seeing something
(dom4j) broken and without running java-1.5-fixer?
subversion - http://bugs.gentoo.org/show_bug.cgi?id=141940
and for aspectwerkz, maybe the fixer script should check if the "broken"
jar belongs to package that actually is supposed to be (requires) 1.5...
Caster
--
gentoo-java@gentoo.org mailing list
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 11:01 ` Caster
@ 2006-07-28 11:12 ` Krzysiek Pawlik
2006-07-28 11:59 ` Caster
1 sibling, 0 replies; 16+ messages in thread
From: Krzysiek Pawlik @ 2006-07-28 11:12 UTC (permalink / raw
To: Caster; +Cc: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 317 bytes --]
Caster wrote:
> Why not revbump jaxme so people will get the fix before seeing something
> (dom4j) broken and without running java-1.5-fixer?
-r2 will hit rsync mirrors soon.
--
Krzysiek Pawlik <nelchael at gentoo.org> key id: 0xBC555551
desktop-misc, desktop-dock, desktop-wm, x86, java, apache...
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 10:54 ` Wiktor Wandachowicz
@ 2006-07-28 11:26 ` Miroslav Šulc
0 siblings, 0 replies; 16+ messages in thread
From: Miroslav Šulc @ 2006-07-28 11:26 UTC (permalink / raw
To: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
Wiktor Wandachowicz napsal(a):
> 06-07-28, Miroslav Šulc wrote:
>> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
>> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
>> =dev-java/jaxme-0.3.1-r1 =dev-java/jaxme-0.3.1-r1
>
> This one is already fixed, see:
> http://bugs.gentoo.org/show_bug.cgi?id=141940
>
> Do:
>
> # emerge --sync
> # emerge -avC jaxme
>
> and proceed as usual. Alternatively add the third step:
>
> # emerge -av1 jaxme
Thank you, that helped :-)
> Good luck and search the Bugzilla more often ;)
I'll try to ;-)
> Wiktor
Miroslav
[-- Attachment #2: miroslav.sulc.vcf --]
[-- Type: text/x-vcard, Size: 349 bytes --]
begin:vcard
fn;quoted-printable:Miroslav =C5=A0ulc
n;quoted-printable:=C5=A0ulc;Miroslav
org:StartNet s.r.o.
adr;quoted-printable;quoted-printable:;;Schodov=C3=A1 309/10;Praha 5;;150 00;=C4=8Cesk=C3=A1 republika
email;internet:miroslav.sulc@startnet.cz
tel;cell:+420 603 711 413
x-mozilla-html:TRUE
url:http://www.startnet.cz
version:2.1
end:vcard
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 11:01 ` Caster
2006-07-28 11:12 ` Krzysiek Pawlik
@ 2006-07-28 11:59 ` Caster
2006-07-28 12:27 ` Miroslav Šulc
1 sibling, 1 reply; 16+ messages in thread
From: Caster @ 2006-07-28 11:59 UTC (permalink / raw
To: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 373 bytes --]
Caster wrote:
> and for aspectwerkz, maybe the fixer script should check if the "broken"
> jar belongs to package that actually is supposed to be (requires) 1.5...
>
Tried to alter the fixer script to do that, by checking the package.env
for GENERATION="2" and TARGET="1.5" or "1.6" and skip such packages as
they are valid to have 1.5+ bytecode. Patch attached.
Caster
[-- Attachment #2: java-1.5-fixer.patch --]
[-- Type: text/x-patch, Size: 2181 bytes --]
--- java-1.5-fixer 2006-07-18 12:43:03.000000000 +0200
+++ java-1.5-fixer 2006-07-28 13:55:15.000000000 +0200
@@ -60,29 +60,68 @@
fi
}
+# $1 - package.env file
+# $2 - name of VAR=foo variable
+get_value_from_package_env() {
+ # get the VAR line from package.env
+ local line="$(grep ${2} ${1})"
+
+ # strip VAR=
+ local value="${line#${2}=}"
+
+ # strip quotes
+ value="${value//\"/}"
+
+ echo ${value}
+}
+
get_jars_from_package_env() {
local package_env=${1}
# keep track of the original classpath
local save_classpath=${CLASSPATH}
- local classpath_line=$(grep CLASSPATH ${package_env})
- # strip CLASSPATH=
- local package_classpath=${classpath_line#CLASSPATH=}
- # strip quotes
- package_classpath=${package_classpath//\"/}
- #local package_classpath=$(source ${package_env} >/dev/null 2>&1; echo ${CLASSPATH})
+ # get classpath from package.env
+ package_classpath=$(get_value_from_package_env ${package_env} CLASSPATH)
echo ${package_classpath//:/ }
}
+check_package_env_valid_gen2_target_15() {
+ local generation=$(get_value_from_package_env ${1} GENERATION)
+
+ debug_print "${1} generation: ${generation}"
+
+ # packages with generation 1 or without generation won't have TARGET and shouldn't be 1.5
+ if [[ "${generation}" != "2" ]]; then
+ return 1
+ fi
+
+ local target=$(get_value_from_package_env ${1} TARGET)
+
+ debug_print "${1} target: $target"
+
+ # packages with target 1.5 or 1.6 are valid to have 1.5+ bytecode, skip them
+ if [[ "${target}" = "1.5" || "${target}" = "1.6" ]]; then
+ return 0
+ fi
+
+ # bytecode should be under 1.5, check it
+ return 1
+}
+
get_jars() {
local package_envs=$@
local package_env
local all_jars
# for each package.env file
for package_env in ${package_envs}; do
- if [[ -f ${package_env} ]]; then
+ if [[ -f ${package_env} ]]; then
+ #check if package is valid gen2 with 1.5+ target
+ if $(check_package_env_valid_gen2_target_15 ${package_env}); then
+ debug_print "skipping ${package_env}"
+ continue
+ fi
debug_print "parsing ${package_env}"
# figure out what jars are in it
local jars=$(get_jars_from_package_env ${package_env})
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 11:59 ` Caster
@ 2006-07-28 12:27 ` Miroslav Šulc
2006-07-28 14:06 ` Caster
0 siblings, 1 reply; 16+ messages in thread
From: Miroslav Šulc @ 2006-07-28 12:27 UTC (permalink / raw
To: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 737 bytes --]
Caster napsal(a):
> Caster wrote:
>
>> and for aspectwerkz, maybe the fixer script should check if the "broken"
>> jar belongs to package that actually is supposed to be (requires) 1.5...
>>
>>
>
> Tried to alter the fixer script to do that, by checking the package.env
> for GENERATION="2" and TARGET="1.5" or "1.6" and skip such packages as
> they are valid to have 1.5+ bytecode. Patch attached.
>
I've tried the patch and aspectwerkz dissapeared from the output :-)
Subversion is still there because I didn't apply the subversion patch
you created but am waiting till it appears in sync.
BTW, maybe a stupid question, but why the jaxme and aspectwerkz appeared
in the emerge command several times?
> Caster
>
Miroslav
[-- Attachment #2: miroslav.sulc.vcf --]
[-- Type: text/x-vcard, Size: 361 bytes --]
begin:vcard
fn;quoted-printable:Miroslav =C5=A0ulc
n;quoted-printable:=C5=A0ulc;Miroslav
org:StartNet s.r.o.
adr;quoted-printable;quoted-printable:;;Schodov=C3=A1 309/10;Praha 5;;150 00;=C4=8Cesk=C3=A1 republika
email;internet:miroslav.sulc@startnet.cz
tel;cell:+420 603 711 413
x-mozilla-html:TRUE
url:http://www.startnet.cz
version:2.1
end:vcard
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 12:27 ` Miroslav Šulc
@ 2006-07-28 14:06 ` Caster
2006-07-28 14:50 ` Miroslav Šulc
2006-07-28 16:02 ` Krzysiek Pawlik
0 siblings, 2 replies; 16+ messages in thread
From: Caster @ 2006-07-28 14:06 UTC (permalink / raw
To: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 567 bytes --]
Miroslav Šulc wrote:
> BTW, maybe a stupid question, but why the jaxme and aspectwerkz appeared
> in the emerge command several times?
Because the fixer is one dirty hack :D
Well for some reason, sed -e 's/ /\n/' doesn't correctly replace all
characters but only the first? Changed it to 'y/ /\n/' which seems to
work better (I'm sure there's more elegant solution anyway). Attached
patch that works as the previous one, and also changes the sed line. You
need to revert my previous patch to apply this (or remerge
java-config-wrapper before).
Caster
[-- Attachment #2: java-1.5-fixer.patch --]
[-- Type: text/x-patch, Size: 2351 bytes --]
--- java-1.5-fixer 2006-07-18 12:43:03.000000000 +0200
+++ java-1.5-fixer 2006-07-28 15:52:22.000000000 +0200
@@ -60,29 +60,68 @@
fi
}
+# $1 - package.env file
+# $2 - name of VAR=foo variable
+get_value_from_package_env() {
+ # get the VAR line from package.env
+ local line="$(grep ${2} ${1})"
+
+ # strip VAR=
+ local value="${line#${2}=}"
+
+ # strip quotes
+ value="${value//\"/}"
+
+ echo ${value}
+}
+
get_jars_from_package_env() {
local package_env=${1}
# keep track of the original classpath
local save_classpath=${CLASSPATH}
- local classpath_line=$(grep CLASSPATH ${package_env})
- # strip CLASSPATH=
- local package_classpath=${classpath_line#CLASSPATH=}
- # strip quotes
- package_classpath=${package_classpath//\"/}
- #local package_classpath=$(source ${package_env} >/dev/null 2>&1; echo ${CLASSPATH})
+ # get classpath from package.env
+ package_classpath=$(get_value_from_package_env ${package_env} CLASSPATH)
echo ${package_classpath//:/ }
}
+check_package_env_valid_gen2_target_15() {
+ local generation=$(get_value_from_package_env ${1} GENERATION)
+
+ debug_print "${1} generation: ${generation}"
+
+ # packages with generation 1 or without generation won't have TARGET and shouldn't be 1.5
+ if [[ "${generation}" != "2" ]]; then
+ return 1
+ fi
+
+ local target=$(get_value_from_package_env ${1} TARGET)
+
+ debug_print "${1} target: $target"
+
+ # packages with target 1.5 or 1.6 are valid to have 1.5+ bytecode, skip them
+ if [[ "${target}" = "1.5" || "${target}" = "1.6" ]]; then
+ return 0
+ fi
+
+ # bytecode should be under 1.5, check it
+ return 1
+}
+
get_jars() {
local package_envs=$@
local package_env
local all_jars
# for each package.env file
for package_env in ${package_envs}; do
- if [[ -f ${package_env} ]]; then
+ if [[ -f ${package_env} ]]; then
+ #check if package is valid gen2 with 1.5+ target
+ if $(check_package_env_valid_gen2_target_15 ${package_env}); then
+ debug_print "skipping ${package_env}"
+ continue
+ fi
debug_print "parsing ${package_env}"
# figure out what jars are in it
local jars=$(get_jars_from_package_env ${package_env})
@@ -116,7 +155,7 @@
fi
done
- sed -e 's/ /\n/' <<< ${broken_packages} | sort | uniq
+ sed -e 'y/ /\n/' <<< ${broken_packages} | sort | uniq
}
fix_packages() {
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 14:06 ` Caster
@ 2006-07-28 14:50 ` Miroslav Šulc
2006-07-28 16:02 ` Krzysiek Pawlik
1 sibling, 0 replies; 16+ messages in thread
From: Miroslav Šulc @ 2006-07-28 14:50 UTC (permalink / raw
To: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 869 bytes --]
Caster napsal(a):
> Miroslav Šulc wrote:
>
>> BTW, maybe a stupid question, but why the jaxme and aspectwerkz appeared
>> in the emerge command several times?
>>
>
> Because the fixer is one dirty hack :D
> Well for some reason, sed -e 's/ /\n/' doesn't correctly replace all
> characters but only the first? Changed it to 'y/ /\n/' which seems to
> work better (I'm sure there's more elegant solution anyway). Attached
> patch that works as the previous one, and also changes the sed line. You
> need to revert my previous patch to apply this (or remerge
> java-config-wrapper before).
>
I patched a copy ;-) Anyway I cannot test it now because except
subversion (which apart from the other packages displayed in the list
only once) I have my system java-fixed. But I can confirm the patch
applied and fixer runs :-)
> Caster
Miroslav
[-- Attachment #2: miroslav.sulc.vcf --]
[-- Type: text/x-vcard, Size: 361 bytes --]
begin:vcard
fn;quoted-printable:Miroslav =C5=A0ulc
n;quoted-printable:=C5=A0ulc;Miroslav
org:StartNet s.r.o.
adr;quoted-printable;quoted-printable:;;Schodov=C3=A1 309/10;Praha 5;;150 00;=C4=8Cesk=C3=A1 republika
email;internet:miroslav.sulc@startnet.cz
tel;cell:+420 603 711 413
x-mozilla-html:TRUE
url:http://www.startnet.cz
version:2.1
end:vcard
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-java] Falling to the lowest jdk available
2006-07-28 14:06 ` Caster
2006-07-28 14:50 ` Miroslav Šulc
@ 2006-07-28 16:02 ` Krzysiek Pawlik
1 sibling, 0 replies; 16+ messages in thread
From: Krzysiek Pawlik @ 2006-07-28 16:02 UTC (permalink / raw
To: Caster; +Cc: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 300 bytes --]
Caster wrote:
> Well for some reason, sed -e 's/ /\n/' doesn't correctly replace all
> characters but only the first?
sed -e 's/..../g' <- note the last *g*.
--
Krzysiek Pawlik <nelchael at gentoo.org> key id: 0xBC555551
desktop-misc, desktop-dock, desktop-wm, x86, java, apache...
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2006-07-28 16:03 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-28 9:09 [gentoo-java] Falling to the lowest jdk available Miroslav Šulc
2006-07-28 9:24 ` Krzysiek Pawlik
2006-07-28 10:33 ` Miroslav Šulc
2006-07-28 10:43 ` Krzysiek Pawlik
2006-07-28 11:01 ` Caster
2006-07-28 11:12 ` Krzysiek Pawlik
2006-07-28 11:59 ` Caster
2006-07-28 12:27 ` Miroslav Šulc
2006-07-28 14:06 ` Caster
2006-07-28 14:50 ` Miroslav Šulc
2006-07-28 16:02 ` Krzysiek Pawlik
2006-07-28 10:44 ` Caster
2006-07-28 9:31 ` Caster
2006-07-28 10:40 ` Miroslav Šulc
2006-07-28 10:54 ` Wiktor Wandachowicz
2006-07-28 11:26 ` Miroslav Šulc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox