Author: gmascellani-guest
Date: 2009-05-20 15:16:12 +0000 (Wed, 20 May 2009)
New Revision: 2223

Modified:
   packages/josm/trunk/debian/changelog
   packages/josm/trunk/debian/josm.sh
Log:
Use java alternative if known to work


Modified: packages/josm/trunk/debian/changelog
===================================================================
--- packages/josm/trunk/debian/changelog        2009-05-20 15:14:42 UTC (rev 
2222)
+++ packages/josm/trunk/debian/changelog        2009-05-20 15:16:12 UTC (rev 
2223)
@@ -2,8 +2,9 @@
 
   * debian/josm.sh: wrong java executable path for java 1.5.0 (closes: 
#525020).
     Thanks to Ross Burton for the report.
+  * debian/josm.sh: use java alternative if known to work (closes: #521125).
 
- -- Giovanni Mascellani <g.mascell...@gmail.com>  Tue, 21 Apr 2009 17:52:55 
+0200
+ -- Giovanni Mascellani <g.mascell...@gmail.com>  Wed, 20 May 2009 17:13:51 
+0200
 
 josm (0.0.svn1529-1) unstable; urgency=low
 

Modified: packages/josm/trunk/debian/josm.sh
===================================================================
--- packages/josm/trunk/debian/josm.sh  2009-05-20 15:14:42 UTC (rev 2222)
+++ packages/josm/trunk/debian/josm.sh  2009-05-20 15:16:12 UTC (rev 2223)
@@ -2,10 +2,17 @@
 # Simple wrapper script used to start JOSM in Debian
 set -e
 
-# First, the users preference as defined by $JAVA_HOME. Next, use OpenJDK.
+# First, the alternative (if known to work) or users preference as defined by 
$JAVA_HOME. Next, use OpenJDK or Sun's proprietary JDK.
 # Override to a specific one using $JAVACMD
+ALTERNATIVE_JDK="`readlink -n -f /etc/alternatives/java`"
 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-6-openjdk/bin/java 
/usr/lib/jvm/java-6-sun/bin/java /usr/lib/jvm/java-1.5.0-sun/bin/java"
 
+for jcmd in $JAVA_CMDS; do
+       if [[ "z$ALTERNATIVE_JDK" == "z`readlink -n -f $jcmd`" ]] && [ -z 
"${JAVACMD}" ]; then
+        JAVACMD="$jcmd"
+    fi
+done
+
 for jcmd in $JAVA_CMDS; do 
     if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then
         JAVACMD="$jcmd"


_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-grass-devel

Reply via email to