Updated patch with (much) more comments.

Thomas
diff -Nru lirc-0.9.0~pre1/debian/changelog lirc-0.9.0~pre1/debian/changelog
--- lirc-0.9.0~pre1/debian/changelog	2011-03-06 22:16:30.000000000 +0100
+++ lirc-0.9.0~pre1/debian/changelog	2013-03-07 16:58:28.000000000 +0100
@@ -1,3 +1,11 @@
+lirc (0.9.0~pre1-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Avoid prompt when conffiles are not modified by the system administrator
+    (Closes: #655969).
+
+ -- Thomas Preud'homme <robo...@debian.org>  Tue, 12 Feb 2013 18:24:27 +0100
+
 lirc (0.9.0~pre1-1) unstable; urgency=low
 
   [ Sven Mueller ]
diff -Nru lirc-0.9.0~pre1/debian/lirc.preinst lirc-0.9.0~pre1/debian/lirc.preinst
--- lirc-0.9.0~pre1/debian/lirc.preinst	1970-01-01 01:00:00.000000000 +0100
+++ lirc-0.9.0~pre1/debian/lirc.preinst	2013-03-07 17:15:35.000000000 +0100
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+	upgrade)
+		oldconfmd5=$(md5sum /etc/lirc/hardware.conf | cut -d ' ' -f 1)
+		# In Squeeze, lirc's postinst empties the value of DRIVER
+		# from /etc/lirc/hardware.conf if the value equals
+		# "UNCONFIGURED". Since this file defaults to "UNCONFIGURED",
+		# it is subsequently modified by the postinst.
+		#
+		# The code below check whether the md5 of the file matches the
+		# one of the file after a default install. If that is the case,
+		# the code reverts the change made by the postinst to prevent
+		# asking questions to the administrator when no file were
+		# modified.
+		if [ "$oldconfmd5" = "566ee1cfca73380a6ec4af14c7d874cd" ]
+		then
+			sed -i "s/^\(DRIVER\)=\"/\1=\"UNCONFIGURED/" /etc/lirc/hardware.conf
+		fi;;
+	install|abort-upgrade)
+		;;
+
+	*)
+		echo "preinst called with unknown argument \`$1'" >&2
+		exit 1
+		;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0

Attachment: signature.asc
Description: This is a digitally signed message part.



Reply via email to