tags 657465 + pending
thanks

Dear maintainer,

I've prepared an NMU for conserver (versioned as 8.1.18-2.1) and
uploaded it to DELAYED/2 (with a small change compared to my last
proposal). 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: Beatles
diff -u conserver-8.1.18/debian/changelog conserver-8.1.18/debian/changelog
--- conserver-8.1.18/debian/changelog
+++ conserver-8.1.18/debian/changelog
@@ -1,3 +1,17 @@
+conserver (8.1.18-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix "prompting due to modified conffiles which where not modified by
+    the user":
+    - don't install the conffile template below /etc but below /usr/share
+    - copy it in .postinst if the file in /etc doesn't exist yet
+    - read existing values in .config
+    - fix replacement in .postinst
+    - remove the correct file in .postrm
+    (Closes: #657465)
+
+ -- gregor herrmann <gre...@debian.org>  Thu, 11 Oct 2012 19:06:36 +0200
+
 conserver (8.1.18-2) unstable; urgency=low
 
   * added lsb-init patch from Bernhard Schmidt (closes: #672468)
diff -u conserver-8.1.18/debian/conserver-client.config conserver-8.1.18/debian/conserver-client.config
--- conserver-8.1.18/debian/conserver-client.config
+++ conserver-8.1.18/debian/conserver-client.config
@@ -2,6 +2,16 @@
 
 . /usr/share/debconf/confmodule
 
+conf=/etc/conserver/console.cf
+
+if [ -r $conf ]; then
+	SERVER=$(perl -ne 'print $1 if /master\s+([^;]+);/' $conf)
+	PORT=$(perl   -ne 'print $1 if /port\s+([^;]+);/'   $conf)
+
+	db_set conserver-client/server "$SERVER"
+	db_set conserver-client/port   "$PORT"
+fi
+
 db_input medium conserver-client/config || true
 db_go
 
diff -u conserver-8.1.18/debian/conserver-client.install conserver-8.1.18/debian/conserver-client.install
--- conserver-8.1.18/debian/conserver-client.install
+++ conserver-8.1.18/debian/conserver-client.install
@@ -1,2 +1,2 @@
-debian/console.cf	/etc/conserver
+debian/console.cf	/usr/share/conserver-client
 console/console		/usr/bin
diff -u conserver-8.1.18/debian/conserver-client.postinst conserver-8.1.18/debian/conserver-client.postinst
--- conserver-8.1.18/debian/conserver-client.postinst
+++ conserver-8.1.18/debian/conserver-client.postinst
@@ -6,14 +6,18 @@
 if [ "$1" = "configure" -a -e /usr/share/debconf/confmodule ]; then
 	. /usr/share/debconf/confmodule
 
+	if [ ! -e $conf ]; then
+		cp /usr/share/conserver-client/console.cf $conf
+	fi
+
 	db_get conserver-client/config
 	if [ "$RET" = "true" ]; then
 
 		touch $conf
 		db_get conserver-client/server
-		perl -pi -e "s/\w+;$/$RET;/ if /^master\s/" $conf
+		perl -pi -e "s/master(?<space>\s+)([^;]+);/master$+{space}$RET;/" $conf
 		db_get conserver-client/port
-		perl -pi -e "s/\w+;$/$RET;/ if /^port\s/" $conf
+		perl -pi -e "s/port(?<space>\s+)([^;]+);/port$+{space}$RET;/"     $conf
 	fi
 fi
 
diff -u conserver-8.1.18/debian/conserver-client.postrm conserver-8.1.18/debian/conserver-client.postrm
--- conserver-8.1.18/debian/conserver-client.postrm
+++ conserver-8.1.18/debian/conserver-client.postrm
@@ -5,7 +5,7 @@
 
 case "$1" in
 purge)
-	rm -f /etc/conserver/console.conf
+	rm -f /etc/conserver/console.cf
 	# try remove the confdirectory (why isn't there a 'prerm purge'?)
 	if [ -d /etc/conserver ]; then
 		rmdir --ignore-fail-on-non-empty /etc/conserver

Attachment: signature.asc
Description: Digital signature

Reply via email to