On Wed, 08 Dec 2010 19:38:40 +0100, gregor herrmann wrote:

> > leave it at 1 and do not touch it anymore.
> Ok, might be less intrusive and simpler than the ucf option.
> And just wrapping the last part of the postinst into a block checking
> if the default-file exists should work.

Attached is a draft for this change.
 
> > The init.d script should be changed in order to warn the user when
> > action is "start" and the flag is at 0, the start action should return a
> > 0 status in order to have upgrade script working correctly, isn't it?
> Right.

That's already in the init script, as far as I can see.
 
Cheers,
gregor
 
-- 
 .''`.   http://info.comodo.priv.at/ -- GPG key IDs: 0x8649AA06, 0x00F3CFE4
 : :' :  Debian GNU/Linux user, admin, & developer - http://www.debian.org/
 `. `'   Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe
   `-    NP: Peter Ratzenbeck: Foggey Dew
diff -Nru hylafax-6.0.5/debian/changelog hylafax-6.0.5/debian/changelog
--- hylafax-6.0.5/debian/changelog	2010-12-07 17:42:55.000000000 +0100
+++ hylafax-6.0.5/debian/changelog	2010-12-09 13:52:45.000000000 +0100
@@ -1,3 +1,12 @@
+hylafax (2:6.0.5-4.2) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Fix "prompting due to modified conffiles which where not modified by
+    the user": write to /etc/default/hylafax only if it doesn't exist
+    (closes: #603429).
+
+ -- gregor herrmann <gre...@debian.org>  Thu, 09 Dec 2010 13:50:21 +0100
+
 hylafax (2:6.0.5-4.1) UNRELEASED; urgency=low
 
   * Non-maintainer upload.
diff -Nru hylafax-6.0.5/debian/hylafax-server.hylafax.default hylafax-6.0.5/debian/hylafax-server.hylafax.default
--- hylafax-6.0.5/debian/hylafax-server.hylafax.default	2010-08-13 23:11:55.000000000 +0200
+++ hylafax-6.0.5/debian/hylafax-server.hylafax.default	1970-01-01 01:00:00.000000000 +0100
@@ -1,56 +0,0 @@
-# default settings for hylafax server
-
-# try to check for the correct USE_FAXGETTY value
-if grep -E '^[^#]*:respawn:/usr/sbin/fax(getty|modem).*$' /etc/inittab >/dev/null 2>&1 || grep -E '^exec[ \t]*/usr/sbin/fax(getty|modem)' /etc/init/*.conf >/dev/null 2>&1
-then
-	USE_FAXGETTY=init
-else
-	USE_FAXGETTY=yes
-fi
-
-# Arguments for faxgetty command. At least -D should be specified
-# as explained in debian bug #462459.
-FAXGETTYARGS="-D"
-
-# In a send only installation you may want to use faxgetty
-# or faxmodem on lines already configured with faxaddmodem.
-# faxgetty is the new default, faxmodem the old one.
-# For a better understanding of the difference between faxmodem
-# and faxgetty, see http://www.hylafax.org/archive/1999-09/msg00043.php
-#
-# In a send/receive installation you must use faxgetty.
-#
-# To use faxmodem change the following variable value to "no". 
-#
-# You may also prefer to run faxmodem/faxgetty via inittab instead of
-# running it here from a script. In this case set its value as
-# "init".
-# USE_FAXGETTY=yes 
-
-#
-# Uncomment this line once hylafax has been fully configured and/or
-# you want to enable the server.
-#
-# RUN_HYLAFAX=1
-
-#
-# If you need to bind hylafax to one address only, just uncomment
-# this variable and change the value using your preferred IP.
-#
-# BINDTO="-l 127.0.0.1"
-
-#
-# The following variables are automatically assigned by running
-# the faxsetup utility. If you leave them commented out then
-# faxsetup values are used. You may specify here the values to
-# use.
-# 
-# OLDPROT="-o 4557"
-# NEWPROT="-i 4559"
-# SNPP="-s 444"
-
-#
-# hfaxd may be run from inetd while faxq should still be executed
-# by the init script. If you run hfax via inetd or xinetd then
-# uncomment the following line
-# HFAXD_FROM_INET=true
diff -Nru hylafax-6.0.5/debian/hylafax-server.hylafax.default-maintainer hylafax-6.0.5/debian/hylafax-server.hylafax.default-maintainer
--- hylafax-6.0.5/debian/hylafax-server.hylafax.default-maintainer	1970-01-01 01:00:00.000000000 +0100
+++ hylafax-6.0.5/debian/hylafax-server.hylafax.default-maintainer	2010-12-09 13:48:59.000000000 +0100
@@ -0,0 +1,56 @@
+# default settings for hylafax server
+
+# try to check for the correct USE_FAXGETTY value
+if grep -E '^[^#]*:respawn:/usr/sbin/fax(getty|modem).*$' /etc/inittab >/dev/null 2>&1 || grep -E '^exec[ \t]*/usr/sbin/fax(getty|modem)' /etc/init/*.conf >/dev/null 2>&1
+then
+	USE_FAXGETTY=init
+else
+	USE_FAXGETTY=yes
+fi
+
+# Arguments for faxgetty command. At least -D should be specified
+# as explained in debian bug #462459.
+FAXGETTYARGS="-D"
+
+# In a send only installation you may want to use faxgetty
+# or faxmodem on lines already configured with faxaddmodem.
+# faxgetty is the new default, faxmodem the old one.
+# For a better understanding of the difference between faxmodem
+# and faxgetty, see http://www.hylafax.org/archive/1999-09/msg00043.php
+#
+# In a send/receive installation you must use faxgetty.
+#
+# To use faxmodem change the following variable value to "no". 
+#
+# You may also prefer to run faxmodem/faxgetty via inittab instead of
+# running it here from a script. In this case set its value as
+# "init".
+# USE_FAXGETTY=yes 
+
+#
+# Uncomment this line once hylafax has been fully configured and/or
+# you want to enable the server.
+#
+# RUN_HYLAFAX=1
+
+#
+# If you need to bind hylafax to one address only, just uncomment
+# this variable and change the value using your preferred IP.
+#
+# BINDTO="-l 127.0.0.1"
+
+#
+# The following variables are automatically assigned by running
+# the faxsetup utility. If you leave them commented out then
+# faxsetup values are used. You may specify here the values to
+# use.
+# 
+# OLDPROT="-o 4557"
+# NEWPROT="-i 4559"
+# SNPP="-s 444"
+
+#
+# hfaxd may be run from inetd while faxq should still be executed
+# by the init script. If you run hfax via inetd or xinetd then
+# uncomment the following line
+# HFAXD_FROM_INET=true
diff -Nru hylafax-6.0.5/debian/hylafax-server.postinst hylafax-6.0.5/debian/hylafax-server.postinst
--- hylafax-6.0.5/debian/hylafax-server.postinst	2010-12-07 17:49:51.000000000 +0100
+++ hylafax-6.0.5/debian/hylafax-server.postinst	2010-12-09 14:04:46.000000000 +0100
@@ -270,21 +270,24 @@
 	#
 	# ask the user if he want to start hylafax now and warn it about the change in
 	# /etc/default/hylafax.
-	#
-    	db_input low hylafax-server/start_now || true
- 	db_go
- 	db_get hylafax-server/start_now
-	if [ "$RET" = "true" ]; then
-		# removed redirect to /dev/null so that user knows that
-		# hylafax is actually restarting
-		sed -i -e 's/# RUN_HYLAFAX=1/RUN_HYLAFAX=1/' /etc/default/hylafax
-#		invoke-rc.d hylafax stop || true
+	# only if /etc/default/hylafax doesn't exist yet
+	if [ ! -f /etc/default/hylafax ] ; then
+		db_input low hylafax-server/start_now || true
+		db_go
+		db_get hylafax-server/start_now
+		if [ "$RET" = "true" ]; then
+			# removed redirect to /dev/null so that user knows that
+			# hylafax is actually restarting
+			sed -e 's/# RUN_HYLAFAX=1/RUN_HYLAFAX=1/' < /usr/share/hylafax/hylafax.default-maintainer > /etc/default/hylafax
+#			invoke-rc.d hylafax stop || true
 
-		# Added || true in order to complete the installation even if something goes
-		# wrong and the server is not starting
-		# Closes: #357435
-		invoke-rc.d hylafax start || true
-	elif [ $restart = true ]; then
+			# Added || true in order to complete the installation even if something goes
+			# wrong and the server is not starting
+			# Closes: #357435
+			invoke-rc.d hylafax start || true
+		fi
+	fi
+	if [ $restart = true ]; then
 		invoke-rc.d hylafax start || true
 	fi
 
diff -Nru hylafax-6.0.5/debian/rules hylafax-6.0.5/debian/rules
--- hylafax-6.0.5/debian/rules	2010-10-12 13:17:47.000000000 +0200
+++ hylafax-6.0.5/debian/rules	2010-12-09 14:24:22.000000000 +0100
@@ -116,6 +116,8 @@
 	cp -p debian/lintian.override.hylafax-server \
 		$(d_server)/usr/share/lintian/overrides/$(p_server)
 
+	cp debian/hylafax-server.hylafax.default-maintainer $(d_server)/usr/share/hylafax/hylafax.default-maintainer
+
 	install --mode=a+rx -p debian/copy_configuration_from_spool $(d_server)/usr/lib/hylafax/bin/
 
 override_dh_installman:
@@ -163,7 +165,8 @@
 		var/spool/hylafax/etc var/spool/hylafax/recvq var/spool/hylafax/status var/spool/hylafax/sendq \
 		var/spool/hylafax/doneq var/spool/hylafax/docq var/spool/hylafax/tmp var/spool/hylafax/pollq \
 		usr/share/man/man5 usr/share/man/man8 \
-		usr/share/lintian/overrides
+		usr/share/lintian/overrides \
+		usr/share/hylafax
 	dh_installdirs -p$(p_client) \
 		etc/hylafax \
 		usr/bin \

Attachment: signature.asc
Description: Digital signature

Reply via email to