Package: javahelper
Version: 0.19
Severity: normal
Tags: patch

1. If Debian-Java-Home has several entries, jh_depends sets the Java VM to 
only one of the listed VMs.
2. Non-free sun Java VMs takes precedence over the free OpenJDK Java VM, 
even if the OpenJDK one was listed before Sun's VM in Debian-Java-Home.

The attached patch fixes those issues.

-- System Information:
Debian Release: 5.0
  APT prefers jaunty-updates
  APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 
'jaunty-proposed'), (500, 'jaunty-backports'), (500, 'jaunty')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-13-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages javahelper depends on:
ii  bsdmainutils      6.1.10ubuntu3          collection of more utilities from 
ii  debhelper         7.2.8ubuntu1           helper programs for debian/rules
ii  devscripts        2.10.48ubuntu1~jaunty1 scripts to make the life of a Debi
ii  fastjar           2:0.97-3               Jar creation utility
pn  gcj               <none>                 (no description available)
ii  python            2.6.2-0ubuntu1         An interactive high-level object-o
ii  python-debian     0.1.12ubuntu2          Python modules to work with Debian
pn  python-scriptutil <none>                 (no description available)
ii  realpath          1.12                   Return the canonicalized absolute 
ii  zip               2.32-1                 Archiver for .zip files

javahelper recommends no packages.

javahelper suggests no packages.
* Parallel check for JHOME, to support the case of multiple entries in 
  Debian-Java-Home
* Moved openjdk entry above sun* entries to make it take precedence over sun* 
  JREs
* JVM=default only if no java home entries were found neither in the MANIFEST 
  nor supplied by jh_depends -j
diff -ur javatools-0.19.orig/jh_depends javatools-0.19/jh_depends
--- javatools-0.19.orig/jh_depends      2009-07-14 21:06:27.000000000 +0300
+++ javatools-0.19/jh_depends   2009-07-14 21:31:39.000000000 +0300
@@ -104,18 +104,21 @@
          JHOME="`extractline META-INF/MANIFEST.MF Debian-Java-Home`"
          if echo $JHOME | grep headless >/dev/null; then
             JVM="$JVM headless"
-         elif echo $JHOME | grep default >/dev/null; then
+         fi
+         if echo $JHOME | grep default >/dev/null; then
             JVM="$JVM default"
-         elif echo $JHOME | grep gcj >/dev/null; then
+         fi
+         if echo $JHOME | grep gcj >/dev/null; then
             JVM="$JVM gcj"
-         elif echo $JHOME | grep 1.5.0-sun >/dev/null; then
+         fi
+         if echo $JHOME | grep 6-openjdk >/dev/null; then
+            JVM="$JVM open"
+         fi
+         if echo $JHOME | grep 1.5.0-sun >/dev/null; then
             JVM="sun5"
-         elif echo $JHOME | grep 6-sun >/dev/null; then
+         fi
+         if echo $JHOME | grep 6-sun >/dev/null; then
             JVM="$JVM sun6"
-         elif echo $JHOME | grep 6-openjdk >/dev/null; then
-            JVM="$JVM open"
-                       else
-                               JVM="$JVM default"
          fi
       fi
       [ -n "$TEMPDIR" ] && rm -rf "$TEMPDIR/"*
@@ -152,6 +155,11 @@
    if [ -n "`getarg j jvm`" ] && [ -z "$JVM" ]; then
       JVM="`getarg j jvm`"
    fi
+
+   if [ -z "$JVM" ]; then
+      JVM="default"
+   fi
+
    if [ -n "$JVM" ]; then
       for j in $JVM; do
                        alternateversiondeps=`getalternatedepends $classversion`

Reply via email to