[Dbconfig-common-devel] dbconfig-common/dpkg common,1.20,1.21 config,1.16,1.17

seanius@haydn.debian.org seanius@haydn.debian.org


Update of /cvsroot/dbconfig-common/dbconfig-common/dpkg
In directory haydn:/org/alioth.debian.org/chroot/home/users/seanius/tmp/cvs-serv11001/dpkg

Modified Files:
	common config 
Log Message:
bugfixes and a couple enhancements:

  * dbconfig-common now defaults to blank passwords implying the
    admin wants a random password (this makes automatic installations
    even easier) thanks to Tobias Grimm <tobias.grimm@e-tobi.net> for
    the inspiration.
  * the admin is prompted only once if the app. password is blank.  thanks
    to tobias for the idea.
  * added dependency on pwgen for generating passwords.
  * the manpage for dbconfig-generate-include was never built into
    the binary.  d'oh!
  * character encoding fix in the changelog to make lintian happy.
  * limit mysql usernames to 16 characters long, as that's a built
    in limit.
  * the dbc_log functions now always produce output, as it's actually
    helpful to see what's going on.
  * dbconfig-generate-include has changed behavior.  -P/--dbport is now for 
    port and -m/--mode is for mode (was -P/--perms, but i can't think of
    a good name for port otherwise!).
  * forget the host/port responses if reconfigured to use a local connection.
    otherwise that causes confusion.
  * better error notification in the internal mysql code.
  * if something goes wrong in the install process, forget that we've
    seen the relevant debconf questions (so they will be asked again).




Index: common
===================================================================
RCS file: /cvsroot/dbconfig-common/dbconfig-common/dpkg/common,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- common	27 Apr 2005 02:35:02 -0000	1.20
+++ common	28 Apr 2005 03:11:29 -0000	1.21
@@ -305,6 +305,11 @@
 	db_subst $dbc_package/install-error error $dbc_error
 	db_input critical $dbc_package/install-error || true
 	db_go || true
+	# forget that we've seen all the debconf questions
+	set -x
+	for f in $dbc_register_templates; do
+		db_fset $dbc_package/$f seen false
+	done
 	dbc_postinst_cleanup
 	exit 1
 }
@@ -325,7 +330,7 @@
 }
 
 ##
-## what to do when something goes wrong during upgrade
+## what to do when something goes wrong during remove
 ##
 dbc_remove_error(){
 	echo "error encountered $1:" >&2

Index: config
===================================================================
RCS file: /cvsroot/dbconfig-common/dbconfig-common/dpkg/config,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- config	26 Apr 2005 04:30:54 -0000	1.16
+++ config	28 Apr 2005 03:11:29 -0000	1.17
@@ -152,14 +152,18 @@
 			) | sort | uniq`
 			# turn the list into a comma separated list if it exists
 			# and then substitute it into the list of available hosts
-			# and then ask them for one
 			if [ "$_preconf_list" ]; then
 				_preconf_list=`echo $_preconf_list | sed -e 's/ /, /g'`
 				_preconf_list="new host, $_preconf_list"
 				db_subst $dbc_package/remote/host hosts "$_preconf_list"
-				# choose from a list of remote hosts 
+				# and then ask them for one
 				db_input high $dbc_package/remote/host || true
 			fi
+		# but if it is unix socket, forget all the host stuff
+		else
+			db_reset $dbc_package/remote/host || true
+			db_reset $dbc_package/remote/newhost || true
+			db_reset $dbc_package/remote/port || true
 		fi
 	;;
 	# state 5 - get host / port info if necessary
@@ -174,7 +178,6 @@
 			if [ ! "$host" -o "$host" = "new host" ]; then
 				# prompt them for a new hostname
 				db_input high $dbc_package/remote/newhost || true
-				db_input high $dbc_package/remote/newhost || true
 			fi
 		fi
 	;;
@@ -183,7 +186,6 @@
 		if [ "$dbc_method" != "unix socket" ]; then
 			if [ ! "$host" -o "$host" = "new host" ]; then
 				db_get $dbc_package/remote/newhost 
-				db_get $dbc_package/remote/newhost 
 				newhost="$RET"
 
 				# add the new host to the existing list of hosts
@@ -191,11 +193,11 @@
 				oldhosts="$RET"
 				db_subst $dbc_package/remote/host hosts "$oldhosts, $newhost"
 				db_set $dbc_package/remote/host "$newhost"
+				db_fset $dbc_package/remote/host seen true
 			else
 				# set the "newhost" to the selected host, because
 				# the second time through the configure script we'll
 				# need this set
-				db_set $dbc_package/remote/newhost "$host"
 				db_set $dbc_package/remote/newhost "$host"
 			fi