[jetty9] 109/135: No longer install the default page if another root application is installed (Closes: #767612)

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Thu Dec 17 14:53:19 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 c2c3adba02f39ed14cbecb000e1c0b197658cabf
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Fri Dec 4 10:06:11 2015 +0100

    No longer install the default page if another root application is installed (Closes: #767612)
---
 debian/changelog       |  2 ++
 debian/jetty8.install  |  4 ++--
 debian/jetty8.postinst |  8 ++++++++
 debian/jetty8.postrm   | 16 +++++-----------
 debian/jetty8.prerm    | 10 ++++++++++
 5 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index a6df939..3984c28 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,7 @@
 jetty8 (8.1.18-3) UNRELEASED; urgency=medium
 
+  * No longer install the default page on updates in /var/lib/jetty8/webapps/root
+    if another root application is installed (Closes: #767612)
   * Support the JVMs installed by the older versions of java-package (<< 0.52)
     and the oracle-java{n > 7}-installer packages from webupd8.
   * Updated the error message displayed when the JAVA_HOME variable defined
diff --git a/debian/jetty8.install b/debian/jetty8.install
index d532ec9..0853332 100644
--- a/debian/jetty8.install
+++ b/debian/jetty8.install
@@ -13,8 +13,8 @@ jetty-server/src/main/config/etc/*           etc/jetty8
 jetty-util/src/main/config/etc/*             etc/jetty8
 jetty-webapp/src/main/config/etc/*           etc/jetty8
 
-debian/root-webapp/*                                 var/lib/jetty8/webapps/root
-test-jetty-webapp/src/main/webapp/jetty_banner.gif   var/lib/jetty8/webapps/root
+debian/root-webapp/*                                 usr/share/jetty8/default-root
+test-jetty-webapp/src/main/webapp/jetty_banner.gif   usr/share/jetty8/default-root
 jetty-distribution/src/main/resources/start.ini      etc/jetty8
 jetty-distribution/src/main/resources/etc/*          etc/jetty8
 jetty-distribution/src/main/resources/contexts       etc/jetty8
diff --git a/debian/jetty8.postinst b/debian/jetty8.postinst
index a2e6ab5..c994444 100644
--- a/debian/jetty8.postinst
+++ b/debian/jetty8.postinst
@@ -6,6 +6,14 @@ JETTY_GROUP=jetty
 
 case "$1" in
     configure)
+	# Install the default page if no root context exist
+	if [ ! -f /var/lib/jetty8/webapps/root.war ]; then
+		mkdir -p /var/lib/jetty8/webapps/root
+		if [ -z "$(ls -A /var/lib/jetty8/webapps/root)" ]; then
+			cp /usr/share/jetty8/default-root/* /var/lib/jetty8/webapps/root
+		fi
+	fi
+
 	if ! id jetty > /dev/null 2>&1 ; then
 	    adduser --system --home /usr/share/jetty8 --no-create-home \
 		--group --disabled-password --shell /bin/false \
diff --git a/debian/jetty8.postrm b/debian/jetty8.postrm
index 100340a..258b68e 100644
--- a/debian/jetty8.postrm
+++ b/debian/jetty8.postrm
@@ -8,17 +8,11 @@ rm -rf /var/cache/jetty8/*
 
 case "$1" in
     remove)
-        # Remove ROOT webapp if not modified
-        RWLOC="/var/lib/jetty8/webapps/root"
-        RWFILES="$RWLOC/index.html $RWLOC/jetty_banner.gif"
-        if [ "`(cat $RWFILES | md5sum -) 2>/dev/null | cut -d ' ' -f 1`" \
-                            = "12471c4b3020defb7ebd30ef84c0f9dd" ] ; then
-            rm $RWFILES
-            rmdir --ignore-fail-on-non-empty \
-                /var/lib/jetty8/webapps/root \
-                /var/lib/jetty8/webapps \
-                /var/lib/jetty8 || true
-        fi
+        rmdir --ignore-fail-on-non-empty \
+            /var/lib/jetty8/webapps/root \
+            /var/lib/jetty8/webapps \
+            /var/lib/jetty8 || true
+
         if [ -d "/var/cache/jetty8" ] ; then
             rm -rf /var/cache/jetty8
         fi
diff --git a/debian/jetty8.prerm b/debian/jetty8.prerm
index deb986b..bbbf6fc 100644
--- a/debian/jetty8.prerm
+++ b/debian/jetty8.prerm
@@ -9,6 +9,16 @@ case "$1" in
         if [ -f "/etc/authbind/byuid/$JETTY_UID" ]; then
                 rm -f /etc/authbind/byuid/$JETTY_UID
         fi
+
+        # Remove the default page
+        if cmp --silent /var/lib/jetty8/webapps/root/index.html /usr/share/jetty8/default-root/index.html
+        then
+                rm /var/lib/jetty8/webapps/root/index.html
+        fi
+        if cmp --silent /var/lib/jetty8/webapps/root/jetty_banner.gif /usr/share/jetty8/default-root/jetty_banner.gif
+        then
+                rm /var/lib/jetty8/webapps/root/jetty_banner.gif
+        fi
     ;;
 esac
 

-- 
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