On Sat, Dec 18, 2010 at 09:34:15PM +0100, gregor herrmann wrote:
> On Sat, 11 Dec 2010 18:33:34 +0100, Lucas Nussbaum wrote:
> 
> > > Setting up sendfile (2.1b.20080616-4) ...
> > > 
> > > Configuration file `/etc/cron.weekly/sendfile'
> > > ==> File on system created by you or by a script.
> > > ==> File also in package provided by package maintainer.
> 
> This is probably (related to) #553563, fixed since 2.1b.20080616-2.1.

Yes, the issue is that when /etc/cron.weekly/sendfile becomes a conffile,
dpkg assumes that the file from the previous version of the package was put
there manually.

A patch implementing one possible fix is attached: if 
/etc/cron.weekly/sendfile is present and its md5sum matches that of the
original file from 2.1b.20080616-2, then remove it in preinst. dpkg is then
happy to install the new version without prompting.

Note that this doesn't handle the case where the original file has been
removed by the user… it will install the new file. Not sure whether there's
much that can be done about that.

-- 
Chris Butler <chr...@debian.org>
  GnuPG Key ID: 4096R/49E3ACD3
diff -urN tmp/sendfile-2.1b.20080616//debian/changelog sendfile-2.1b.20080616//debian/changelog
--- tmp/sendfile-2.1b.20080616//debian/changelog	2010-12-19 16:07:19.000000000 +0000
+++ sendfile-2.1b.20080616//debian/changelog	2010-12-19 17:25:58.286789275 +0000
@@ -1,3 +1,11 @@
+sendfile (2.1b.20080616-4.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Check if /etc/cron.weekly/sendfile is unmodified when upgrading from
+    lenny, and remove it if so; avoids spurious dpkg warning (closes: #606777)
+
+ -- Chris Butler <chr...@debian.org>  Sun, 19 Dec 2010 15:31:42 +0000
+
 sendfile (2.1b.20080616-4) unstable; urgency=low
 
   * Terminate weekly cronjob (sf_cleenup) preemptively when no sendfile
diff -urN tmp/sendfile-2.1b.20080616//debian/preinst sendfile-2.1b.20080616//debian/preinst
--- tmp/sendfile-2.1b.20080616//debian/preinst	1970-01-01 01:00:00.000000000 +0100
+++ sendfile-2.1b.20080616//debian/preinst	2010-12-19 16:12:03.030716723 +0000
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# /etc/cron.weekly/sendfile was marked as a conffile in  2.1b.20080616-2.1.
+# dpkg will warn about local changes even if there aren't any, so if it's
+# unmodified then we remove it. (Bug #606777)
+
+if [ -f /etc/cron.weekly/sendfile ]; then
+	MD5="`md5sum /etc/cron.weekly/sendfile | sed -e 's/ .*//'`"
+	if dpkg --compare-versions "$2" lt "2.1b.20080616-2.1" && [ "${MD5}" = "fe757d596df419aaec4495a9645be94d" ]; then
+		rm /etc/cron.weekly/sendfile
+	fi
+fi
diff -urN tmp/sendfile-2.1b.20080616//debian/rules sendfile-2.1b.20080616//debian/rules
--- tmp/sendfile-2.1b.20080616//debian/rules	2010-12-19 16:07:19.000000000 +0000
+++ sendfile-2.1b.20080616//debian/rules	2010-12-19 15:51:50.650714868 +0000
@@ -54,7 +54,7 @@
 	$(installbin) -d debian/tmp/DEBIAN
 	chown -R root.root debian/tmp
 	chmod -R g-ws debian/tmp
-	$(installbin) debian/{prerm,postinst,postrm} debian/tmp/DEBIAN
+	$(installbin) debian/{preinst,prerm,postinst,postrm} debian/tmp/DEBIAN
 	$(installdoc) debian/conffiles debian/tmp/DEBIAN
 	#
 	$(installbin) -d debian/tmp/usr/share/doc/$(package){,/german}

Reply via email to