[Pkg-utopia-commits] r1436 - in /packages/unstable/dhcdbd/debian:
changelog dhcdbd.dbus-event
dhcdbd.init dhcdbd.postinst dhcdbd.postrm dhcdbd.preinst dhcdbd.prerm rules
biebl at users.alioth.debian.org
biebl at users.alioth.debian.org
Tue Apr 24 23:06:37 UTC 2007
Author: biebl
Date: Tue Apr 24 23:06:35 2007
New Revision: 1436
URL: http://svn.debian.org/wsvn/pkg-utopia/?sc=1&rev=1436
Log:
Install the dhcdbd start script as regular SysV init script
- Rename debian/dhcdbd.dbus-event to debian/dhcdbd.init.
- Add proper LSB header to debian/dhcdbd.init
- debian/rules
+ Don't install /etc/dbus-1/event.d/24dhcdbd anymore.
+ Set DEB_DH_INSTALLINIT_ARGS to start at 24 and stop at 16.
- debian/dhcdbd.{preinst,postinst,postrm}
+ Remove the old conffile /etc/dbus-1/event.d/24dhcdbd on upgrade. If it
was modified locally, rename it to *.dpkg-bak instead.
- debian/dhcdbd.prerm
+ Removed. Stopping dhcdbd in prerm is now automatically added by
dh_installinit.
Added:
packages/unstable/dhcdbd/debian/dhcdbd.init
- copied, changed from r1433, packages/unstable/dhcdbd/debian/dhcdbd.dbus-event
packages/unstable/dhcdbd/debian/dhcdbd.postrm
packages/unstable/dhcdbd/debian/dhcdbd.preinst
Removed:
packages/unstable/dhcdbd/debian/dhcdbd.dbus-event
packages/unstable/dhcdbd/debian/dhcdbd.prerm
Modified:
packages/unstable/dhcdbd/debian/changelog
packages/unstable/dhcdbd/debian/dhcdbd.postinst
packages/unstable/dhcdbd/debian/rules
Modified: packages/unstable/dhcdbd/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/dhcdbd/debian/changelog?rev=1436&op=diff
==============================================================================
--- packages/unstable/dhcdbd/debian/changelog (original)
+++ packages/unstable/dhcdbd/debian/changelog Tue Apr 24 23:06:35 2007
@@ -1,3 +1,20 @@
+dhcdbd (2.0-4) unstable; urgency=low
+
+ * Install the dhcdbd start script as regular SysV init script
+ - Rename debian/dhcdbd.dbus-event to debian/dhcdbd.init.
+ - Add proper LSB header to debian/dhcdbd.init
+ - debian/rules
+ + Don't install /etc/dbus-1/event.d/24dhcdbd anymore.
+ + Set DEB_DH_INSTALLINIT_ARGS to start at 24 and stop at 16.
+ - debian/dhcdbd.{preinst,postinst,postrm}
+ + Remove the old conffile /etc/dbus-1/event.d/24dhcdbd on upgrade. If it
+ was modified locally, rename it to *.dpkg-bak instead.
+ - debian/dhcdbd.prerm
+ + Removed. Stopping dhcdbd in prerm is now automatically added by
+ dh_installinit.
+
+ -- Michael Biebl <biebl at debian.org> Wed, 25 Apr 2007 00:51:45 +0200
+
dhcdbd (2.0-3) unstable; urgency=low
[ Riccardo Setti ]
Copied: packages/unstable/dhcdbd/debian/dhcdbd.init (from r1433, packages/unstable/dhcdbd/debian/dhcdbd.dbus-event)
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/dhcdbd/debian/dhcdbd.init?rev=1436&op=diff
==============================================================================
--- packages/unstable/dhcdbd/debian/dhcdbd.dbus-event (original)
+++ packages/unstable/dhcdbd/debian/dhcdbd.init Tue Apr 24 23:06:35 2007
@@ -1,8 +1,20 @@
#! /bin/sh
+### BEGIN INIT INFO
+# Provides: dhcdbd
+# Required-Start: $local_fs dbus
+# Required-Stop: $local_fs dbus
+# Should-Start: $syslog
+# Should-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: S 0 1 6
+# Short-Description: DHCP D-Bus manager
+# Description: dhcdbd provides a D-DBus interface to dhclient,
+# the DHCP client from ISC.
+### END INIT INFO
#
# DHCP D-Bus daemon
#
-# Author: Michael Biebl <biebl at debian.org>
+# Author: Michael Biebl <biebl at debian.org>
#
set -e
@@ -13,7 +25,7 @@
DAEMON=/usr/sbin/$NAME
DAEMON_OPTS=--system
PIDFILE=/var/run/$NAME.pid
-SCRIPTNAME=/etc/dbus-1/event.d/24$NAME
+SCRIPTNAME=/etc/init.d/$NAME
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
Modified: packages/unstable/dhcdbd/debian/dhcdbd.postinst
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/dhcdbd/debian/dhcdbd.postinst?rev=1436&op=diff
==============================================================================
--- packages/unstable/dhcdbd/debian/dhcdbd.postinst (original)
+++ packages/unstable/dhcdbd/debian/dhcdbd.postinst Tue Apr 24 23:06:35 2007
@@ -1,22 +1,54 @@
-#!/bin/sh
+#!/bin/sh -e
+# This script can be called in the following ways:
+#
+# After the package was installed:
+# <postinst> configure <old-version>
+#
+#
+# If prerm fails during upgrade or fails on failed upgrade:
+# <old-postinst> abort-upgrade <new-version>
+#
+# If prerm fails during deconfiguration of a package:
+# <postinst> abort-deconfigure in-favour <new-package> <version>
+# removing <old-package> <version>
+#
+# If prerm fails during replacement due to conflict:
+# <postinst> abort-remove in-favour <new-package> <version>
-set -e
+
+# Remove a no-longer used conffile
+rm_conffile()
+{
+ CONFFILE="$1"
+
+ if [ -e "$CONFFILE".dpkg-remove ]; then
+ echo "Removing obsolete conffile $CONFFILE"
+ rm -f "$CONFFILE".dpkg-remove
+ fi
+}
+
case "$1" in
- configure)
- # Ask the bus to reload the config file
+ configure)
+ # Upgrade from previous versions
+ if dpkg --compare-versions "$2" lt "2.0-4"; then
+ rm_conffile /etc/dbus-1/event.d/24dhcdbd
+ fi
+
if [ -x "/etc/init.d/dbus" ]; then
- invoke-rc.d dbus force-reload || true
+ invoke-rc.d dbus force-reload || true
fi
+ ;;
+
+ abort-upgrade|abort-deconfigure|abort-remove)
+ ;;
- # Restart dhcdbd service
- if [ -x "/etc/dbus-1/event.d/24dhcdbd" ]; then
- /etc/dbus-1/event.d/24dhcdbd restart
- fi
-
- ;;
+ *)
+ echo "$0 called with unknown argument \`$1'" 1>&2
+ exit 1
+ ;;
esac
#DEBHELPER#
+exit 0
-exit 0
Added: packages/unstable/dhcdbd/debian/dhcdbd.postrm
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/dhcdbd/debian/dhcdbd.postrm?rev=1436&op=file
==============================================================================
--- packages/unstable/dhcdbd/debian/dhcdbd.postrm (added)
+++ packages/unstable/dhcdbd/debian/dhcdbd.postrm Tue Apr 24 23:06:35 2007
@@ -1,0 +1,83 @@
+#!/bin/sh -e
+# This script can be called in the following ways:
+#
+# After the package was removed:
+# <postrm> remove
+#
+# After the package was purged:
+# <postrm> purge
+#
+# After the package was upgraded:
+# <old-postrm> upgrade <new-version>
+# if that fails:
+# <new-postrm> failed-upgrade <old-version>
+#
+#
+# After all of the packages files have been replaced:
+# <postrm> disappear <overwriting-package> <version>
+#
+#
+# If preinst fails during install:
+# <new-postrm> abort-install
+#
+# If preinst fails during upgrade of removed package:
+# <new-postrm> abort-install <old-version>
+#
+# If preinst fails during upgrade:
+# <new-postrm> abort-upgrade <old-version>
+
+
+# Undo removal of a no-longer used conffile
+undo_rm_conffile()
+{
+ CONFFILE="$1"
+
+ if [ ! -e "$CONFFILE" ]; then
+ if [ -e "$CONFFILE".dpkg-bak ]; then
+ echo "Restoring modified conffile $CONFFILE"
+ mv -f "$CONFFILE".dpkg-bak "$CONFFILE"
+ elif [ -e "$CONFFILE".dpkg-remove ]; then
+ echo "Restoring conffile $CONFFILE"
+ mv -f "$CONFFILE".dpkg-remove "$CONFFILE"
+ fi
+ fi
+}
+
+
+# Purge backup conffile
+rm_backup_conffile()
+{
+ CONFFILE="$1"
+ if [ -e "$CONFFILE".dpkg-bak ]; then
+ echo "Purging backup of conffile $CONFFILE"
+ rm -f "$CONFFILE".dpkg-bak
+ fi
+}
+
+
+case "$1" in
+ remove)
+ ;;
+
+ purge)
+ rm_backup_conffile /etc/dbus-1/event.d/24dhcdbd
+ ;;
+
+ upgrade|failed-upgrade|disappear)
+ ;;
+
+ abort-install|abort-upgrade)
+ # Abort upgrade from previous versions
+ if dpkg --compare-versions "$2" lt "2.0-4"; then
+ undo_rm_conffile /etc/dbus-1/event.d/24dhcdbd
+ fi
+ ;;
+
+ *)
+ echo "$0 called with unknown argument \`$1'" 1>&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+exit 0
Added: packages/unstable/dhcdbd/debian/dhcdbd.preinst
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/dhcdbd/debian/dhcdbd.preinst?rev=1436&op=file
==============================================================================
--- packages/unstable/dhcdbd/debian/dhcdbd.preinst (added)
+++ packages/unstable/dhcdbd/debian/dhcdbd.preinst Tue Apr 24 23:06:35 2007
@@ -1,0 +1,60 @@
+#!/bin/sh -e
+# This script can be called in the following ways:
+#
+# Before the package is installed:
+# <new-preinst> install
+#
+# Before removed package is upgraded:
+# <new-preinst> install <old-version>
+#
+# Before the package is upgraded:
+# <new-preinst> upgrade <old-version>
+#
+#
+# If postrm fails during upgrade or fails on failed upgrade:
+# <old-preinst> abort-upgrade <new-version>
+
+
+# Prepare to remove a no-longer used conffile
+prep_rm_conffile()
+{
+ CONFFILE="$1"
+
+ if [ -e "$CONFFILE" ]; then
+ md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
+ old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE '{s/ obsolete$//;s/.* //;p}}\" /var/lib/dpkg/status`"
+ if [ "$md5sum" != "$old_md5sum" ]; then
+ echo "Obsolete conffile $CONFFILE has been modified by you, renaming to .dpkg-bak"
+ mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
+ else
+ mv -f "$CONFFILE" "$CONFFILE".dpkg-remove
+ fi
+ fi
+}
+
+
+case "$1" in
+ install)
+ ;;
+
+ upgrade)
+ # Upgrade from previous versions
+ if dpkg --compare-versions "$2" lt "2.0-4"; then
+ if [ -x "/etc/dbus-1/event.d/24dhcdbd" ]; then
+ /etc/dbus-1/event.d/24dhcdbd stop
+ fi
+ prep_rm_conffile /etc/dbus-1/event.d/24dhcdbd
+ fi
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "$0 called with unknown argument \`$1'" 1>&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+exit 0
Modified: packages/unstable/dhcdbd/debian/rules
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/dhcdbd/debian/rules?rev=1436&op=diff
==============================================================================
--- packages/unstable/dhcdbd/debian/rules (original)
+++ packages/unstable/dhcdbd/debian/rules Tue Apr 24 23:06:35 2007
@@ -7,12 +7,11 @@
DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/debian/dhcdbd/
DEB_MAKE_INVOKE = $(MAKE)
+DEB_DH_INSTALLINIT_ARGS := -- start 24 2 3 4 5 . stop 16 0 1 6 .
binary-install/dhcdbd::
install -d $(CURDIR)/debian/dhcdbd/etc/dhcp3/dhclient-exit-hooks.d/
install -m 644 $(CURDIR)/debian/dhcdbd.dhcp3 \
$(CURDIR)/debian/dhcdbd/etc/dhcp3/dhclient-exit-hooks.d/dhcdbd
- install -D -m 755 $(CURDIR)/debian/dhcdbd.dbus-event \
- $(CURDIR)/debian/dhcdbd/etc/dbus-1/event.d/24dhcdbd
More information about the Pkg-utopia-commits
mailing list