postinst, control: silence ucf (and make it actually work?) with '--debconf-ok' and depend on ucf (>= 0.28) for that; remove unused 'preinst'; update from update-rc.d to insserv in maintainer scripts; disable initscripts *before* they are purged; use bash instead of sh in maintainer scripts because they contain bashisms (postinst: pattern substitution ${RET//,/}, postrm: brace expansion id_rsa{,.pub}, maybe more)
authorMatthias Förste foerste@schlittermann.de
Wed, 30 Nov 2011 11:32:20 +0100
changeset 37 1cdaa46b79c5
parent 36 c45ea25f852c
child 38 5c262b6a659d
postinst, control: silence ucf (and make it actually work?) with '--debconf-ok' and depend on ucf (>= 0.28) for that; remove unused 'preinst'; update from update-rc.d to insserv in maintainer scripts; disable initscripts *before* they are purged; use bash instead of sh in maintainer scripts because they contain bashisms (postinst: pattern substitution ${RET//,/}, postrm: brace expansion id_rsa{,.pub}, maybe more)
debian/changelog
debian/control
debian/postinst
debian/postrm
debian/preinst
--- a/debian/changelog	Wed Nov 30 10:48:57 2011 +0100
+++ b/debian/changelog	Wed Nov 30 11:32:20 2011 +0100
@@ -1,3 +1,14 @@
+ha-sync (0.18+nmu1) stable; urgency=low
+
+  * use bash in maintainer scripts and debian/ha-sync.config because they
+    contain bashisms
+  * fix lsb headers for ha-hostname
+  * fix nodename detection in ha-sync.config
+  * silence ucf (and make it actually work?)
+  * disable init scripts *before* they are purged in postrm
+
+ -- Matthias Förste <foerste@schlittermann.de>  Wed, 30 Nov 2011 11:32:05 +0100
+
 ha-sync (0.18) stable; urgency=low
 
   * updated drbdlinks dependency to >= 1.14 
--- a/debian/control	Wed Nov 30 10:48:57 2011 +0100
+++ b/debian/control	Wed Nov 30 11:32:20 2011 +0100
@@ -7,7 +7,7 @@
 
 Package: ha-sync
 Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, ucf, ssh, stow, rsync (>= 2.6.9), stow
+Depends: ${shlibs:Depends}, ${misc:Depends}, ucf (>= 0.28), ssh, stow, rsync (>= 2.6.9), stow
 Recommends: drbdlinks (>= 1.14)
 Description: sync script for ha cluster
  script helping to keep clusters in sync
--- a/debian/postinst	Wed Nov 30 10:48:57 2011 +0100
+++ b/debian/postinst	Wed Nov 30 11:32:20 2011 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # postinst script for ha-sync
 #
 # see: dh_installdeb(1)
@@ -22,8 +22,8 @@
     configure)
 
 	{
-	    update-rc.d ha-hostname start 3 S . 
-	    update-rc.d ha-config start 30 S . 
+	    insserv ha-hostname
+	    insserv ha-config
 
 	    test -f /etc/ha-sync/id_rsa || {
 		    ssh-keygen -N "" -C "ha-sync@`hostname`" -f /etc/ha-sync/id_rsa >&2
@@ -57,10 +57,10 @@
 	    echo EXCLUDE="'$RET'"
 
 	} >> $TMP
-	ucf $TMP /etc/ha-sync/ha-sync.conf
+	ucf --debconf-ok $TMP /etc/ha-sync/ha-sync.conf
 
 	## Exclude list
-	ucf /usr/share/doc/ha-sync/examples/exclude.ex /etc/ha-sync/exclude
+	ucf --debconf-ok /usr/share/doc/ha-sync/examples/exclude.ex /etc/ha-sync/exclude
 
 	## noch Verzeichnisse
 	source /etc/ha-sync/ha-sync.conf
--- a/debian/postrm	Wed Nov 30 10:48:57 2011 +0100
+++ b/debian/postrm	Wed Nov 30 11:32:20 2011 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # postrm script for ha-sync
 #
 # see: dh_installdeb(1)
@@ -24,8 +24,6 @@
     purge)
     	{
     	rm -f /etc/ha-sync/id_rsa{,.pub}
-	update-rc.d ha-hostname remove || true
-	update-rc.d ha-sync remove || true
 	for p in /etc/ha-sync/{ha-sync.conf,exclude}; do
 		ucf --purge $p; rm -f $p $p.ucf-*
 		ucf --purge $p; rm -f $p $p.ucf-*
@@ -34,6 +32,10 @@
 	;;
 
     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+        {
+	insserv -r ha-hostname
+	insserv -r ha-config
+        } >&2
     ;;
 
     *)
--- a/debian/preinst	Wed Nov 30 10:48:57 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-#!/bin/sh
-# preinst script for ha-sync
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-#        * <new-preinst> `install'
-#        * <new-preinst> `install' <old-version>
-#        * <new-preinst> `upgrade' <old-version>
-#        * <old-preinst> `abort-upgrade' <new-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    install|upgrade)
-
-    ;;
-
-    abort-upgrade)
-    ;;
-
-    *)
-        echo "preinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-