From cc689212ad818533def33a61693d7a22040f444f Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Tue, 18 Jun 2013 21:21:00 +0200 Subject: [PATCH] debian/nut-client.preinst: also revert /etc/nut/nut.conf mangling done by postinst during upgrade from lenny to squeeze (Really closes: #677054) Thanks to Andreas Beckmann for the review. --- debian/changelog | 6 ++++++ debian/nut-client.preinst | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4d5c627..8f3daf2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ nut (2.6.5-3) UNRELEASED; urgency=low + [ Laurent Bigonville ] * debian/control: - Move libupsclient1 package to libs Section - Add libgd-dev to the Build-Depends, keep the other alternatives to ease @@ -9,6 +10,11 @@ nut (2.6.5-3) UNRELEASED; urgency=low getting updated during build - Use canonical URL for the VCS-* fields + [ Ivo De Decker ] + * debian/nut-client.preinst: also revert /etc/nut/nut.conf mangling done + by postinst during upgrade from lenny to squeeze (Really closes: #677054) + Thanks to Andreas Beckmann for the review. + -- Laurent Bigonville Tue, 14 May 2013 18:04:04 +0200 nut (2.6.5-2) experimental; urgency=low diff --git a/debian/nut-client.preinst b/debian/nut-client.preinst index 2107da1..fa1bd01 100644 --- a/debian/nut-client.preinst +++ b/debian/nut-client.preinst @@ -4,6 +4,15 @@ set -e # Revert /etc/nut/nut.conf mangling done by older versions of the postinst # See #677054 +# changed configfile created by a fresh install in lenny, upgraded to squeeze +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`" = 331cca39153f451c2968f4b734c1cf3f ]; then + sed -i '29,$ d' /etc/nut/nut.conf +fi + +# changed configfile created by a fresh install in squeeze if [ "$1" = "install" -o "$1" = "upgrade" ] \ && dpkg --compare-versions "$2" lt "2.6.4-2" \ && [ -f /etc/nut/nut.conf ] \