[pkg-java] r5910 - in trunk/java-wrappers: . debian

fourmond at alioth.debian.org fourmond at alioth.debian.org
Fri Feb 29 20:42:11 UTC 2008


Author: fourmond
Date: 2008-02-29 20:42:11 +0000 (Fri, 29 Feb 2008)
New Revision: 5910

Modified:
   trunk/java-wrappers/debian/changelog
   trunk/java-wrappers/java-wrappers.sh
Log:
[java-wrappers] find_java_runtime now takes several arguments

Modified: trunk/java-wrappers/debian/changelog
===================================================================
--- trunk/java-wrappers/debian/changelog	2008-02-29 20:23:06 UTC (rev 5909)
+++ trunk/java-wrappers/debian/changelog	2008-02-29 20:42:11 UTC (rev 5910)
@@ -1,3 +1,9 @@
+java-wrappers (0.1.4) UNRELEASED; urgency=low
+
+  * Improved find_java_runtime to take several arguments
+
+ -- Vincent Fourmond <fourmond at debian.org>  Wed, 27 Feb 2008 00:42:03 +0100
+
 java-wrappers (0.1.3) unstable; urgency=low
 
   * Small documentation fixes

Modified: trunk/java-wrappers/java-wrappers.sh
===================================================================
--- trunk/java-wrappers/java-wrappers.sh	2008-02-29 20:23:06 UTC (rev 5909)
+++ trunk/java-wrappers/java-wrappers.sh	2008-02-29 20:42:11 UTC (rev 5910)
@@ -56,7 +56,7 @@
 # If JAVA_CMD exists, nothing is done. If JAVA_HOME exists, only that
 # is searched.
 #
-# In the other cases, the runtime is looked for according to one of the
+# In the other cases, the runtime is looked for according to the
 # following arguments:
 #  * 2 : java runtime 2 
 #  * swing : a JVM that has swing
@@ -64,7 +64,11 @@
 #    javax.xml.stream.util.StreamReaderDelegate
 #  * sun: sun's JVM, for stuff depending on the infamous com.sun classes
 #  * sun6: sun's JVM version 6
+#  * icedtea: icedtea
 #
+# More than one argument can be specified; they will be taken into account
+# in that order.
+#
 # If JAVA_DEBUGGER is set, we try to use jdb rather than java, if it is
 # present.
 #
@@ -124,29 +128,41 @@
     fi
 
     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
-	case $1 in
-	    # A java2 runtime
-	    2) DIRS=$java2_runtimes
-		;;
-	    swing) DIRS="$icedtea $sun_java";
-		;;
-	    sun) DIRS=$sun_java
-		;;
-	    sunmax5) DIRS="$sun4 $sun5"
-		;;
-	    sunmin5) DIRS="$sun5 $sun6"
-		;;
-	    sun6) DIRS=$sun6
-		;;
-	    fullxml) DIRS=$xml_extra
-		;;
-	    *) DIRS=$all_runtimes
-		;;
-	esac
-        # And pick up the first one that works
+
+	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"
+		    ;;
+		*) ;;
+	    esac
+	    shift
+	done
+	# Nothing means everything
+	if test -z "$DIRS"; then
+	    DIRS=$all_runtimes
+	fi
+        # And pick up the first one that works reasonably
 	for dir in $DIRS; do
 	    if [ -x $dir/bin/java ]; then
 		JAVA_HOME=$dir




More information about the pkg-java-commits mailing list