[jetty9] 57/135: Updated the init.d script to detect the recent JDKs and ignore the old ones

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Thu Dec 17 14:53:13 UTC 2015


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository jetty9.

commit 173872e2087641a44552e95ea190aa800c8f19d5
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Tue Jul 29 18:16:44 2014 +0200

    Updated the init.d script to detect the recent JDKs and ignore the old ones
---
 debian/changelog   |  2 ++
 debian/jetty8.init | 38 +++++++++++++++++++++++---------------
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8b0ccd3..1f04920 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ jetty8 (8.1.15-1) UNRELEASED; urgency=medium
   * New upstream release
     - Refreshed the patches
     - Ignore the Maven dependency on the Mycila maven-license-plugin
+  * Updated the init.d script to detect the recent JDKs and ignore the old ones
+    (Closes: #756310)
   * debian/control:
     - Removed java5-runtime-headless from the acceptable runtime dependencies
       (Jetty 8 requires Java 6)
diff --git a/debian/jetty8.init b/debian/jetty8.init
index 0e45946..8ff4b7e 100644
--- a/debian/jetty8.init
+++ b/debian/jetty8.init
@@ -114,22 +114,30 @@ JETTY_ARGS=
 # It also sets the maximum heap size to 256M to deal with most cases.
 JAVA_OPTIONS="-Xmx256m -Djava.awt.headless=true"
 
+# This function sets the variable JDK_DIRS
+find_jdks()
+{
+    for java_version in 9 8 7 6
+    do
+        for jvmdir in /usr/lib/jvm/java-${java_version}-openjdk-* \
+                      /usr/lib/jvm/jdk-${java_version}-oracle-* \
+                      /usr/lib/jvm/jre-${java_version}-oracle-*
+        do
+            if [ -d "${jvmdir}" -a "${jvmdir}" != "/usr/lib/jvm/java-${java_version}-openjdk-common" ]
+            then
+                JDK_DIRS="${JDK_DIRS} ${jvmdir}"
+            fi
+        done
+    done
+
+    # Add older non multi arch installations
+    JDK_DIRS="${JDK_DIRS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle"
+}
+
 # The first existing directory is used for JAVA_HOME (if JAVA_HOME is not
-# defined in /etc/default/jetty). Should contain a list of space separated directories.
-JDK_DIRS="
-	  /usr/lib/jvm/default-java \
-	  /usr/lib/jvm/java-6-sun \
-	  /usr/lib/jvm/java-6-openjdk \
-	  /usr/lib/jvm/java-1.5.0-sun \
-	  /usr/lib/jvm/java-gcj \
-	  /usr/lib/j2sdk1.6-sun \
-	  /usr/lib/j2sdk1.5-sun \
-	  /usr/lib/j2sdk1.5-ibm \
-	  /usr/lib/j2sdk1.4-sun \
-	  /usr/lib/j2sdk1.4 \
-	  /usr/lib/j2se/1.4 \
-	  /usr/lib/kaffe/ \
-	 "
+# defined in $DEFAULT)
+JDK_DIRS="/usr/lib/jvm/default-java"
+find_jdks
 
 # Timeout in seconds for the shutdown of all webapps
 JETTY_SHUTDOWN=30

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jetty9.git



More information about the pkg-java-commits mailing list