Gentoo Archives: gentoo-java

From: Joshua Nichols <nichoj@g.o>
To: gentoo-java@l.g.o
Subject: [gentoo-java] looking for contributions to java-1.5-fixer
Date: Fri, 31 Mar 2006 06:51:48
Hey folks,

So, we have a bash script to help people rebuild packages on their
system that were built with Java 1.5. It does help a bit, but it could
definitely could use a little work. People often ask how they can help
out, so I figure it may be a good thing to announce the need for
improving this script.

Here's a brief synopsis of what it does:
 * gets a list of all jars, using the pattern /usr/share/*/lib/*.jar
 * uses a python script, to check what version
bytecode for each jar
 * makes a list of offending jars
 * uses qfile from app-portage/portage-utils to determine what package
it belongs to
 * attempts to emerge all the offending packages

Here are some problems with the current script:
 * Things that are brought onto the classpath for /usr/bin/ant cause
some big trouble. This is because 1.5 bytecode is brought onto the
classpath when you're trying to build 1.4 bytecode.
 * It's not smart enough to emerge stuff in order. As a result, we just
attempt to merge them in a pseudo random order. If a package fails, we
keep track of it to try in another 'run'. If the same packages keep
failing 3 times, the script dies.
 * Some things could be installing jars somewhere beside
/usr/share/*/lib/*.jar  (in particular, to /opt)
 * Some binary packages install jars with 1.5 bytecode. These would be
false positive.

Some corresponding suggestions of how to handle the problems:
* Check ant dependencies first. If there are offending packages, unmerge
those, then remerge
* Try unmerging stuff first. This way, emerge will figure out what order
to put things in
* try parsing CLASSPATH out of /usr/share/*/package.env to get a list of
jars that get installed
 * have a variable with a list of known 1.5 jars. ignore the jar if it's
in this list.

The source for this is in subversion at:
(under src/shell)

So if this sounds up your ally, give it a shot. Hope to hear from someone :)

- Josh
gentoo-java@g.o mailing list