From 00ffc53caa8dce9f101d12db9bdfa7f84a6af20c Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 11 Aug 2012 17:21:01 +0200 Subject: [PATCH] Do not use dpkg-maintscript-helper to remove /etc/init.d/nut --- debian/changelog | 2 +- debian/control | 3 +-- debian/nut-server.maintscript | 3 --- debian/nut-server.postinst | 5 +++++ 4 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 debian/nut-server.maintscript diff --git a/debian/changelog b/debian/changelog index b93c2a9..15898a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,7 @@ nut (2.6.4-2) UNRELEASED; urgency=low * debian/rules: Stop the nut-client before nut-server on systems using static boot ordering (Closes: #679451) - * debian/nut-server.maintscript: Remove /etc/init.d/nut on upgrade + * debian/nut-server.postinst: Remove /etc/init.d/nut on upgrade (Closes: #677822) * Rename nut-server.lintian-overrides to nut-client.lintian-overrides and adjust overrides now that ups-monitor is shipped in nut-client package diff --git a/debian/control b/debian/control index eac3480..e5f9af3 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: admin Priority: optional Maintainer: Arnaud Quette Uploaders: Laurent Bigonville -Build-Depends: debhelper (>= 8.1.0~), +Build-Depends: debhelper (>= 8), cdbs (>= 0.4.90~), libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, @@ -43,7 +43,6 @@ Provides: nut-usb Conflicts: nut-hal-drivers, nut-usb (<< 2.1.0-3), nut-dev (<< 2.2.2) Replaces: nut (<< 2.6.1-2~) Breaks: nut (<< 2.6.1-2~) -Pre-Depends: ${misc:Pre-Depends} Description: network UPS tools - core system Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and diff --git a/debian/nut-server.maintscript b/debian/nut-server.maintscript deleted file mode 100644 index 1d202d4..0000000 --- a/debian/nut-server.maintscript +++ /dev/null @@ -1,3 +0,0 @@ -#Removing obsolete init script. -#The file is gone in 2.6.3-2 but was not removed on upgrades. -rm_conffile /etc/init.d/nut 2.6.4-3~ diff --git a/debian/nut-server.postinst b/debian/nut-server.postinst index c2574b8..7952552 100644 --- a/debian/nut-server.postinst +++ b/debian/nut-server.postinst @@ -49,6 +49,11 @@ case "$1" in && udevadm trigger --subsystem-match=usb --action=change # 557178 udevadm trigger --subsystem-match=usb + + if dpkg --compare-versions "$2" le "2.6.4-2~" ; then + rm -f /etc/init.d/nut + update-rc.d nut remove >/dev/null + fi ;; abort-upgrade)