From a80da4998d7254857d1d01d8fdd8bcfbf1ff68ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Tue, 27 Nov 2012 08:34:19 +0100 Subject: [PATCH] debian/nut-client.preinst: revert /etc/nut/nut.conf mangling done by older versions of the postinst (Closes: #677054) --- debian/changelog | 5 +++++ debian/nut-client.preinst | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 debian/nut-client.preinst diff --git a/debian/changelog b/debian/changelog index 1651395..46f7e6b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,14 @@ nut (2.6.5-2) UNRELEASED; urgency=low + [ Laurent Bigonville ] * debian/control: Move the nut-monitor Suggests from nut-server to nut-client * Restore proper SELinux context for runtime created /var/run/nut directory + [ Sébastien Villemot ] + * debian/nut-client.preinst: revert /etc/nut/nut.conf mangling done by older + versions of the postinst (Closes: #677054) + -- Laurent Bigonville Tue, 09 Oct 2012 23:38:10 +0200 nut (2.6.5-1) experimental; urgency=low diff --git a/debian/nut-client.preinst b/debian/nut-client.preinst new file mode 100644 index 0000000..2107da1 --- /dev/null +++ b/debian/nut-client.preinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +# Revert /etc/nut/nut.conf mangling done by older versions of the postinst +# See #677054 +if [ "$1" = "install" -o "$1" = "upgrade" ] \ + && dpkg --compare-versions "$2" lt "2.6.4-2" \ + && [ -f /etc/nut/nut.conf ] \ + && [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = f9b571ae65952e3a761fac2202633478 ]; then + sed -i 's/^MODE=none$/MODE = none/' /etc/nut/nut.conf +fi + +#DEBHELPER#