Hi,

On Tue, Jan 22, 2013 at 07:10:37PM +0100, gregor herrmann wrote:
> The squeeze version has a nut.postinst that converts /etc/default/nut
> to /etc/nut/nut.conf, so probably the fragments shown in your
> lenny2squeeze file come from there; on a new squeeze install this
> does not happen.
> 
> And now the nut-client.preinst in wheezy and sid [0] reverts some
> mangling but only for an md5sum of f9b571ae65952e3a761fac2202633478,
> i.e. for configs from fresh squeeze installs, and not for
> upgraded-from-lenny files.
> 
> At least that's my guess now - maybe I got something wrong :)
> 
> Now, I'm not sure how to fix this in a sane way.

It seems this can be fixed by just keeping the first part of the config file
in the preinst. The attached patch fixes the piuparts error.

With this patch, piuparts still reports an error on lenny -> squeeze ->
wheezy, but that error seems to be related to the split of the nut package, so
I don't know if this is really an error or just a false positive...

Cheers,

Ivo


diff -Nru nut-2.6.4/debian/changelog nut-2.6.4/debian/changelog
--- nut-2.6.4/debian/changelog	2012-12-20 20:40:14.000000000 +0100
+++ nut-2.6.4/debian/changelog	2013-01-26 16:40:08.000000000 +0100
@@ -1,3 +1,10 @@
+nut (2.6.4-2.3) UNRELEASED; urgency=low
+
+  * debian/nut-client.preinst: also revert /etc/nut/nut.conf mangling done
+    by postinst during upgrade from lenny to squeeze (Really closes: #677054)
+
+ -- Ivo De Decker <ivo.dedec...@ugent.be>  Sat, 26 Jan 2013 16:38:59 +0100
+
 nut (2.6.4-2.2) unstable; urgency=low
 
   * Non-maintainer upload with fixes for wheezy.
diff -Nru nut-2.6.4/debian/nut-client.preinst nut-2.6.4/debian/nut-client.preinst
--- nut-2.6.4/debian/nut-client.preinst	2012-12-20 20:40:14.000000000 +0100
+++ nut-2.6.4/debian/nut-client.preinst	2013-01-26 16:37:44.000000000 +0100
@@ -4,6 +4,15 @@
 
 # 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
+    head -28 /etc/nut/nut.conf > /etc/nut/nut.conf.new && mv /etc/nut/nut.conf.new /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 ] \

Reply via email to