changeset 457:1420216cd450 noffle

[svn] improved ucf transition
author godisch
date Sun, 29 Jun 2003 08:22:59 +0100
parents 7e0c7dd29d53
children 187f5d684589
files debian/changelog debian/postinst
diffstat 2 files changed, 28 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/debian/changelog	Wed Jun 25 18:00:10 2003 +0100
+++ b/debian/changelog	Sun Jun 29 08:22:59 2003 +0100
@@ -1,3 +1,10 @@
+noffle (1.1.5-2) unstable; urgency=low
+
+  * Improved ucf transition preventing confirmation requests for identical
+    files, removed --three-way switch.
+
+ -- Martin A. Godisch <godisch@debian.org>  Sun, 29 Jun 2003 09:21:20 +0200
+
 noffle (1.1.5-1) unstable; urgency=low
 
   * New upstream release,
--- a/debian/postinst	Wed Jun 25 18:00:10 2003 +0100
+++ b/debian/postinst	Sun Jun 29 08:22:59 2003 +0100
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: postinst 598 2003-06-25 16:58:46Z godisch $
+# $Id: postinst 601 2003-06-29 07:22:59Z godisch $
 
 set -e
 
@@ -41,14 +41,22 @@
 		sed "s/^default-expire[[:space:]].*/default-expire $defexpire/" \
 		> /etc/news/noffle.conf.new
 	chgrp news /etc/news/noffle.conf.new
-	ucf --three-way /etc/news/noffle.conf.new /etc/news/noffle.conf < /dev/tty
+	if cmp -s /etc/news/noffle.conf /etc/news/noffle.conf.new; then
+		UCF_FORCE_CONFFNEW=YES ucf /etc/news/noffle.conf.new /etc/news/noffle.conf < /dev/tty
+	else
+		ucf /etc/news/noffle.conf.new /etc/news/noffle.conf < /dev/tty
+	fi
 	rm -f /etc/news/noffle.conf.new
 
 	umask 022
 	cat /usr/share/noffle/conf.debian | \
 		sed "s/^NOFFLE_FETCHMODE=.*/NOFFLE_FETCHMODE=$fetchmode/" \
 		> /etc/default/noffle.new
-	ucf --three-way /etc/default/noffle.new /etc/default/noffle < /dev/tty
+	if cmp -s /etc/default/noffle /etc/default/noffle.new; then
+		UCF_FORCE_CONFFNEW=YES ucf /etc/default/noffle.new /etc/default/noffle < /dev/tty
+	else
+		ucf /etc/default/noffle.new /etc/default/noffle < /dev/tty
+	fi
 	rm -f /etc/default/noffle.new
 
 	db_get noffle/port
@@ -61,8 +69,16 @@
 
 	db_stop
 else
-	ucf --three-way /usr/share/noffle/noffle.conf /etc/news/noffle.conf < /dev/tty
-	ucf --three-way /usr/share/noffle/conf.debian /etc/default/noffle < /dev/tty
+	if cmp -s /etc/news/noffle.conf /usr/share/noffle/noffle.conf; then
+		UCF_FORCE_CONFFNEW=YES ucf /usr/share/noffle/noffle.conf /etc/news/noffle.conf < /dev/tty
+	else
+		ucf /usr/share/noffle/noffle.conf /etc/news/noffle.conf < /dev/tty
+	fi
+	if cmp -s /etc/default/noffle /usr/share/noffle/conf.debian; then
+		UCF_FORCE_CONFFNEW=YES ucf /usr/share/noffle/conf.debian /etc/default/noffle < /dev/tty
+	else
+		ucf /usr/share/noffle/conf.debian /etc/default/noffle < /dev/tty
+	fi
 	port="`grep "/usr/bin/noffle -r" /etc/inetd.conf 2> /dev/null | sed 's/[[:space:]].*$//'`" || true
 	if [ "$port" ]; then
 		update-inetd --enable "$port"