[phpBB] svn: r55 - trunk/phpbb2

jeroen at wolffelaar.nl jeroen at wolffelaar.nl
Sun Feb 8 20:15:02 CET 2004


Author: jeroen
Date: 2004-02-08 20:14:12 +0100 (Sun, 08 Feb 2004)
New Revision: 55

Modified:
   trunk/phpbb2/phpbb2-conf-mysql.postinst
Log:
Bailout postinst if some part of the setup fails


Modified: trunk/phpbb2/phpbb2-conf-mysql.postinst
===================================================================
--- trunk/phpbb2/phpbb2-conf-mysql.postinst	2004-02-08 18:53:22 UTC (rev 54)
+++ trunk/phpbb2/phpbb2-conf-mysql.postinst	2004-02-08 19:14:12 UTC (rev 55)
@@ -15,6 +15,9 @@
 	eval db$i'="$RET"'
 done
 
+# purge database rootpassword
+db_reset phpbb2-conf-mysql/dbrootpass
+
 if [ -z "$dbpass" ]; then
 	if [ -z "$dbpass_generated" ]; then
 		dbpass="`makepasswd --chars 12`"
@@ -24,9 +27,15 @@
 	fi
 fi
 
-# Just to allow breaking out of DB config:
-while true; do
-#
+bailout ()
+{
+	echo "Postinstallation of phpbb2-conf-mysql failed. Run"
+	echo "\`dpkg --configure -a' to retry"
+	for i in setup server name user pass; do
+		db_fset phpbb2-conf-mysql/db$i seen false
+	done
+	exit 1
+}
 
 	db_get phpbb2-conf-mysql/db_created
 	if [ "$dbsetup" = Create ] && [ "$RET" != true ]; then
@@ -39,7 +48,7 @@
 				db_subst phpbb2-conf-mysql/dbfailcreate error $(echo "$error"|head -1)
 				db_input high phpbb2-conf-mysql/dbfailcreate || true
 				db_go || true
-				break
+				bailout
 			fi
 
 			dballow=localhost
@@ -53,7 +62,7 @@
 				db_subst phpbb2-conf-mysql/dbfailcreateuser error $(echo "$error"|head -1) 
 				db_input high phpbb2-conf-mysql/dbfailcreateuser || true
 				db_go || true
-				break
+				bailout
 			fi
 			db_set phpbb2-conf-mysql/db_created true
 	fi
@@ -82,7 +91,7 @@
 				db_subst phpbb2-conf-mysql/dbfailcreatetables error $(echo "$error"|head -1)
 				db_input high phpbb2-conf-mysql/dbfailcreatetables || true
 				db_go || true
-				break 2
+				bailout
 				;;
 			nothing|exec)
 				# this is the table layout version, manually updated
@@ -94,16 +103,8 @@
 				exit 1
 			esac
 	fi
-			
-# end for allowing breaking out of DB config
-break
-done
 
-# purge database rootpassword
-db_reset phpbb2-conf-mysql/dbrootpass
-
 # Install/update config file
-	echo "Creating config file..."
 	tmpfile=`mktemp /tmp/phpbb2.config.php.XXXXXX`
 
 	cat <<-NEWCONFIG > $tmpfile





More information about the phpBB-l mailing list