[pkg-java] r6730 - in trunk/java-wrappers: . debian
fourmond at alioth.debian.org
fourmond at alioth.debian.org
Tue Jul 22 21:51:49 UTC 2008
Author: fourmond
Date: 2008-07-22 21:51:47 +0000 (Tue, 22 Jul 2008)
New Revision: 6730
Added:
trunk/java-wrappers/jvm-list.sh
Modified:
trunk/java-wrappers/debian/changelog
trunk/java-wrappers/debian/java-wrappers.install
trunk/java-wrappers/java-wrappers.sh
Log:
[java-wrappers] Beginnings of a newer scheme for find_java_runtime
Modified: trunk/java-wrappers/debian/changelog
===================================================================
--- trunk/java-wrappers/debian/changelog 2008-07-22 19:45:29 UTC (rev 6729)
+++ trunk/java-wrappers/debian/changelog 2008-07-22 21:51:47 UTC (rev 6730)
@@ -1,3 +1,10 @@
+java-wrappers (0.1.7) UNRELEASED; urgency=low
+
+ * NOT RELEASED YET
+ * Rewrite of find_java_runtime in a much more flexible fashion...
+
+ -- Vincent Fourmond <fourmond at debian.org> Tue, 22 Jul 2008 23:49:08 +0200
+
java-wrappers (0.1.6) unstable; urgency=low
* Add openjdk6 to the list of runtime flavors
Modified: trunk/java-wrappers/debian/java-wrappers.install
===================================================================
--- trunk/java-wrappers/debian/java-wrappers.install 2008-07-22 19:45:29 UTC (rev 6729)
+++ trunk/java-wrappers/debian/java-wrappers.install 2008-07-22 21:51:47 UTC (rev 6730)
@@ -1 +1,2 @@
-java-wrappers.sh usr/lib/java-wrappers
\ No newline at end of file
+java-wrappers.sh usr/lib/java-wrappers
+jvm-list.sh usr/lib/java-wrappers
\ No newline at end of file
Modified: trunk/java-wrappers/java-wrappers.sh
===================================================================
--- trunk/java-wrappers/java-wrappers.sh 2008-07-22 19:45:29 UTC (rev 6729)
+++ trunk/java-wrappers/java-wrappers.sh 2008-07-22 21:51:47 UTC (rev 6730)
@@ -15,6 +15,10 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# Import the list of JVMs
+
+. /usr/lib/java-wrappers/jvm-list.sh
+
# Display a debugging message
java_debug() {
if [ "$DEBUG_WRAPPER" ]; then
@@ -56,37 +60,7 @@
#
# This information is currently *far from complete* !!!
find_java_runtime() {
- # First, known runtimes:
- sun5="/usr/lib/jvm/java-1.5.0-sun /usr/lib/j2*1.5-sun"
- sun4="/usr/lib/j2*1.4-sun"
- sun6="/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun"
-
- sun_java="$sun4 $sun5 $sun6"
-
- gcj2="/usr/lib/jvm/java-*-gcj-4.* "
- sablevm="/usr/lib/sablevm"
- kaffe="/usr/lib/kaffe /usr/lib/kaffe/pthreads /usr/lib/kaffe/jthreads"
- icedtea="/usr/lib/jvm/java-7-icedtea"
- cacao="/usr/lib/jvm/cacao"
-
- openjdk6="/usr/lib/jvm/java-6-openjdk"
-
- # IBM, coming from argouml.sh
- ibm="/usr/lib/j2*1.[456]-ibm"
-
- # Then, classes of JVM:
- all_runtimes="$gcj2 $cacao $sablevm $kaffe $icedtea $sun_java $ibm /usr/lib/jvm/*"
-
- # Java2 runtimes:
- java2_runtimes="$gcj2 $iced_tea $sun_java $ibm"
-
- # Full swing runtimes:
- full_swing_runtimes="$iced_tea $sun_java $ibm"
-
- # Sun java apparently has some XML functions more than concurrents:
- xml_extra="/usr/lib/jvm/java-6-sun /usr/lib/jvm/java-1.5.0-sun"
-
if [ "$JAVA_CMD" ]; then
if which "$JAVA_CMD" > /dev/null; then
java_debug "Using already set JAVA_CMD = '$JAVA_CMD' => '"`which "$JAVA_CMD"`"'"
@@ -114,34 +88,20 @@
if [ -z "$JAVA_HOME" ]; then
# We now try to look for a reasonable JAVA_HOME.
- # First, narrow the choices, approximately according to what
- # was asked
+ # First, narrow the choices according to what
+ # was asked.
+ #
+ # Please see the list of understood jvms in
+ # /usr/lib/java-wrappers/jvm-list.sh
DIRS=""
while test "$1"
do
- case $1 in
- # A java2 runtime
- 2) DIRS="$DIRS $java2_runtimes"
- ;;
- swing) DIRS="$DIRS $icedtea $sun_java";
- ;;
- sun) DIRS="$DIRS $sun_java"
- ;;
- sunmax5) DIRS="$DIRS $sun4 $sun5"
- ;;
- sunmin5) DIRS="$DIRS $sun5 $sun6"
- ;;
- sun6) DIRS="$DIRS $sun6"
- ;;
- fullxml) DIRS="$DIRS $xml_extra"
- ;;
- icedtea) DIRS="$icedtea"
- ;;
- openjdk) DIRS="$openjdk6"
- ;;
- *) ;;
- esac
+ found_jvm=$(eval "echo -n \$__jvm_$1")
+ if [ test -z "$found_jvm" ]; then
+ java_warning "JVM flavor '${1:-none}' not understood"
+ else
+ DIRS="$DIRS $found_jvm"
shift
done
# Nothing means everything
Added: trunk/java-wrappers/jvm-list.sh
===================================================================
--- trunk/java-wrappers/jvm-list.sh (rev 0)
+++ trunk/java-wrappers/jvm-list.sh 2008-07-22 21:51:47 UTC (rev 6730)
@@ -0,0 +1,47 @@
+# jvm-list.sh: a list of available JVM and some shortcuts
+# Copyright 2008 by Vincent Fourmond <fourmond at debian.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# All variables defined here can be used as arguments for the
+# find_java_runtime function if you strip the __jvm_ at the beginning
+# of the variable...
+
+# Sun runtimes
+__jvm_sun4="/usr/lib/j2*1.4-sun"
+__jvm_sun5="/usr/lib/jvm/java-1.5.0-sun /usr/lib/j2*1.5-sun"
+__jvm_sun6="/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun"
+
+# all sun runtimes
+__jvm_sun="$__jvm_sun4 $__jvm_sun5 $__jvm_sun6"
+
+# IBM runtimes. This comes from argouml.sh
+__jvm_ibm="/usr/lib/j2*1.[456]-ibm"
+
+
+# Now, free runtimes:
+__jvm_gcj2="/usr/lib/jvm/java-*-gcj-4.* "
+__jvm_sablevm="/usr/lib/sablevm"
+__jvm_kaffe="/usr/lib/kaffe /usr/lib/kaffe/pthreads /usr/lib/kaffe/jthreads"
+__jvm_icedtea="/usr/lib/jvm/java-7-icedtea"
+__jvm_cacao="/usr/lib/jvm/cacao"
+__jvm_openjdk6="/usr/lib/jvm/java-6-openjdk"
+
+# And a few aliases
+__jvm_gcj="$__jvm_gcj2"
+__jvm_openjdk="$__jvm_openjdk6"
+
+
+# Probably here should come a few meaningful global aliases.
\ No newline at end of file
More information about the pkg-java-commits
mailing list