[pkg-java] r5270 - trunk/tomcat5.5/debian

mkoch at alioth.debian.org mkoch at alioth.debian.org
Thu Jan 3 08:17:44 UTC 2008


Author: mkoch
Date: 2008-01-03 08:17:44 +0000 (Thu, 03 Jan 2008)
New Revision: 5270

Added:
   trunk/tomcat5.5/debian/tomcat55.cron.daily
Removed:
   trunk/tomcat5.5/debian/tomcat5.5.cron.daily
Modified:
   trunk/tomcat5.5/debian/changelog
   trunk/tomcat5.5/debian/rules
   trunk/tomcat5.5/debian/tomcat5.5.postinst
   trunk/tomcat5.5/debian/tomcat5.5.preinst
Log:
* Renamed /etc/cron.daily/tomcat5.5 to /etc/cron.daily/tomcat55.
  Closes: #454296.


Modified: trunk/tomcat5.5/debian/changelog
===================================================================
--- trunk/tomcat5.5/debian/changelog	2008-01-03 00:33:02 UTC (rev 5269)
+++ trunk/tomcat5.5/debian/changelog	2008-01-03 08:17:44 UTC (rev 5270)
@@ -8,8 +8,10 @@
     Closes: #452366.
   * debian/tomcat5.5.init: Check user id of the user running the init script.
     Closes: #457956.
+  * Renamed /etc/cron.daily/tomcat5.5 to /etc/cron.daily/tomcat55.
+    Closes: #454296.
 
- -- Michael Koch <konqueror at gmx.de>  Wed, 02 Jan 2008 14:26:06 +0100
+ -- Michael Koch <konqueror at gmx.de>  Thu, 03 Jan 2008 09:23:52 +0100
 
 tomcat5.5 (5.5.25-4) unstable; urgency=high
 

Modified: trunk/tomcat5.5/debian/rules
===================================================================
--- trunk/tomcat5.5/debian/rules	2008-01-03 00:33:02 UTC (rev 5269)
+++ trunk/tomcat5.5/debian/rules	2008-01-03 08:17:44 UTC (rev 5270)
@@ -56,7 +56,7 @@
 	dh_installdocs
 	dh_installexamples
 	dh_installinit -- defaults 90 10
-	dh_installcron
+	dh_installcron --name=tomcat55
 	# Prune files that should not be installed at all.
 	rm build/dist/bin/{*.bat,commons-*.jar}
 	dh_install

Deleted: trunk/tomcat5.5/debian/tomcat5.5.cron.daily
===================================================================
--- trunk/tomcat5.5/debian/tomcat5.5.cron.daily	2008-01-03 00:33:02 UTC (rev 5269)
+++ trunk/tomcat5.5/debian/tomcat5.5.cron.daily	2008-01-03 08:17:44 UTC (rev 5270)
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-NAME=tomcat5.5
-DEFAULT=/etc/default/$NAME
-
-# The following variables can be overwritten in $DEFAULT
-
-# Default for number of days to keep old log files in /var/log/tomcat4/
-LOGFILE_DAYS=14
-
-# End of variables that can be overwritten in $DEFAULT
-
-# overwrite settings from default file
-if [ -f "$DEFAULT" ]; then
-	. "$DEFAULT"
-fi
-
-if [ -d /var/log/$NAME ]; then
-	find /var/log/$NAME/ -name \*.log -mtime +$LOGFILE_DAYS -print0 \
-		| xargs --no-run-if-empty -0 rm
-fi
-

Modified: trunk/tomcat5.5/debian/tomcat5.5.postinst
===================================================================
--- trunk/tomcat5.5/debian/tomcat5.5.postinst	2008-01-03 00:33:02 UTC (rev 5269)
+++ trunk/tomcat5.5/debian/tomcat5.5.postinst	2008-01-03 08:17:44 UTC (rev 5270)
@@ -1,5 +1,17 @@
 #!/bin/sh -e
 
+# Move a conffile without triggering a dpkg question
+mv_conffile() {
+    OLDCONFFILE="$1"
+    NEWCONFFILE="$2"
+
+    if [ -e "$OLDCONFFILE" ]; then
+        echo "Preserving user changes to $NEWCONFFILE ..."
+        mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
+        mv -f "$OLDCONFFILE" "$NEWCONFFILE"
+    fi
+}
+
 case "$1" in
     configure)
 	if ! id tomcat55 > /dev/null 2>&1 ; then
@@ -13,7 +25,12 @@
 	chmod -R 770 /etc/tomcat5.5
 	chmod 750 /var/log/tomcat5.5 /etc/tomcat5.5
 	chmod 700 /var/cache/tomcat5.5
-   ln -sf /etc/tomcat5.5 /var/lib/tomcat5.5/conf 
+	ln -sf /etc/tomcat5.5 /var/lib/tomcat5.5/conf 
+
+	# Moving conffiles.
+	if dpkg --compare-versions "$2" le "5.5.25-4"; then
+	    mv_conffile "/etc/cron.daily/tomcat5.5" "/etc/cron.daily/tomcat55"
+	fi
     ;;
 esac
 

Modified: trunk/tomcat5.5/debian/tomcat5.5.preinst
===================================================================
--- trunk/tomcat5.5/debian/tomcat5.5.preinst	2008-01-03 00:33:02 UTC (rev 5269)
+++ trunk/tomcat5.5/debian/tomcat5.5.preinst	2008-01-03 08:17:44 UTC (rev 5270)
@@ -1,6 +1,30 @@
 #!/bin/sh
 
+# Prepare to move a conffile without triggering a dpkg question
+prep_mv_conffile() {
+    PKGNAME="$1"
+    CONFFILE="$2"
+
+    if [ -e "$CONFFILE" ]; then
+        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
+        old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
+        if [ "$md5sum" = "$old_md5sum" ]; then
+            rm -f "$CONFFILE"
+        fi
+    fi
+}
+
 case "$1" in
+    install|upgrade)
+
+      # Rename conffiles gracefully.
+      if dpkg --compare-versions "$2" le "5.5.25-4"; then
+          prep_mv_conffile tomcat5.5 "/etc/cron.daily/tomcat5.5"
+      fi
+    ;;
+esac
+
+case "$1" in
     upgrade)
 
       # Migrate any user config from /var/lib/tomcat5.5/conf to

Copied: trunk/tomcat5.5/debian/tomcat55.cron.daily (from rev 5261, trunk/tomcat5.5/debian/tomcat5.5.cron.daily)
===================================================================
--- trunk/tomcat5.5/debian/tomcat55.cron.daily	                        (rev 0)
+++ trunk/tomcat5.5/debian/tomcat55.cron.daily	2008-01-03 08:17:44 UTC (rev 5270)
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+NAME=tomcat5.5
+DEFAULT=/etc/default/$NAME
+
+# The following variables can be overwritten in $DEFAULT
+
+# Default for number of days to keep old log files in /var/log/tomcat4/
+LOGFILE_DAYS=14
+
+# End of variables that can be overwritten in $DEFAULT
+
+# overwrite settings from default file
+if [ -f "$DEFAULT" ]; then
+	. "$DEFAULT"
+fi
+
+if [ -d /var/log/$NAME ]; then
+	find /var/log/$NAME/ -name \*.log -mtime +$LOGFILE_DAYS -print0 \
+		| xargs --no-run-if-empty -0 rm
+fi
+




More information about the pkg-java-commits mailing list