tags 688378 + patch
tags 688378 + pending
thanks

Dear maintainer,

I've prepared an NMU for gom (versioned as 0.30.2-5.4) and
uploaded it to DELAYED/2. Please feel free to tell me if I
should delay it longer.

Regards.

-- 
 .''`.  Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer  -  http://www.debian.org/
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: STS: Fürstenfeld
diff -Nru gom-0.30.2/debian/changelog gom-0.30.2/debian/changelog
--- gom-0.30.2/debian/changelog	2012-09-11 03:30:48.000000000 +0200
+++ gom-0.30.2/debian/changelog	2012-10-03 22:17:41.000000000 +0200
@@ -1,3 +1,18 @@
+gom (0.30.2-5.4) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix "modifies conffiles (policy 10.7.3): /etc/default/gom":
+    - don't ship /etc/default/gom, it's created in the postinst
+    - update handling of /etc/default/gom in postinst:
+      + create a new file if it doesn't exist
+      + update the existing one otherwise (instead of always writing it from
+        scratch, thus overwriting comments etc.)
+      + don't put date in /etc/default/gom
+    - remove in in postrm/purge
+    (Closes: #688378)
+
+ -- gregor herrmann <gre...@debian.org>  Wed, 03 Oct 2012 22:17:10 +0200
+
 gom (0.30.2-5.3) unstable; urgency=low
 
   * Non-maintainer upload.
diff -Nru gom-0.30.2/debian/gom.default gom-0.30.2/debian/gom.default
--- gom-0.30.2/debian/gom.default	2009-09-15 19:25:24.000000000 +0200
+++ gom-0.30.2/debian/gom.default	1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-# Use debconf to configure this file.
-#auto_init="false"
-#valid_sound_devices="sound alsa"
diff -Nru gom-0.30.2/debian/gom.postinst gom-0.30.2/debian/gom.postinst
--- gom-0.30.2/debian/gom.postinst	2009-09-15 19:25:24.000000000 +0200
+++ gom-0.30.2/debian/gom.postinst	2012-10-03 22:04:48.000000000 +0200
@@ -8,14 +8,29 @@
 fi
 
 CONFFILE="/etc/default/gom"
+if [ ! -e $CONFFILE ] ; then
+	echo '# Use debconf to configure this file.' > $CONFFILE
+	echo 'auto_init="false"' >> $CONFFILE
+	echo 'valid_sound_devices="sound alsa"' >> $CONFFILE
+fi
+
 db_get gom/auto_init || true
 auto_init="${RET}"
 db_get gom/valid_sound_devices || true
 valid_sound_devices="${RET}"
-cat <<EOF >${CONFFILE}
-# Generated by postinst on `date`.
-auto_init="${auto_init}"
-valid_sound_devices="${valid_sound_devices}"
-EOF
+
+cp -a -f $CONFFILE $CONFFILE.tmp
+
+# If the admin deleted or commented some variables but then set
+# them via debconf, (re-)add them to the conffile.
+test -z "$auto_init" || grep -Eq '^ *auto_init=' $CONFFILE || \
+	echo "auto_init=" >> $CONFFILE
+test -z "$valid_sound_devices" || grep -Eq '^ *valid_sound_devices=' $CONFFILE || \
+	echo "valid_sound_devices=" >> $CONFFILE
+	  
+sed -e "s/^ *auto_init=.*/auto_init=\"$auto_init\"/" \
+	-e "s/^ *valid_sound_devices=.*/valid_sound_devices=\"$valid_sound_devices\"/" \
+	< $CONFFILE > $CONFFILE.tmp
+mv -f $CONFFILE.tmp $CONFFILE
 
 #DEBHELPER#
diff -Nru gom-0.30.2/debian/gom.postrm gom-0.30.2/debian/gom.postrm
--- gom-0.30.2/debian/gom.postrm	2009-09-15 19:25:24.000000000 +0200
+++ gom-0.30.2/debian/gom.postrm	2012-10-03 22:13:47.000000000 +0200
@@ -11,6 +11,7 @@
 			rm -r -f /etc/gom
 		fi
 	fi
+	rm -f /etc/default/gom
 fi
 
 #DEBHELPER#

Attachment: signature.asc
Description: Digital signature

Reply via email to