[phpBB] svn: r49 - trunk/phpbb2

jeroen at wolffelaar.nl jeroen at wolffelaar.nl
Sun Feb 8 15:51:01 CET 2004


Author: jeroen
Date: 2004-02-08 15:50:39 +0100 (Sun, 08 Feb 2004)
New Revision: 49

Modified:
   trunk/phpbb2/control
   trunk/phpbb2/phpbb2-conf-mysql.config
   trunk/phpbb2/phpbb2-conf-mysql.postinst
   trunk/phpbb2/phpbb2-conf-mysql.templates
   trunk/phpbb2/phpbb2.config
Log:
Remove quite some needless questions since the split, use ucf for config.php
now, lowered priorities of debconf questions.


Modified: trunk/phpbb2/control
===================================================================
--- trunk/phpbb2/control	2004-02-06 01:38:32 UTC (rev 48)
+++ trunk/phpbb2/control	2004-02-08 14:50:39 UTC (rev 49)
@@ -21,7 +21,7 @@
 
 Package: phpbb2-conf-mysql
 Architecture: all
-Depends: phpbb2, ${misc:Depends}, wwwconfig-common (>= 0.0.33), php4-mysql, mysql-client, makepasswd
+Depends: phpbb2, ${misc:Depends}, wwwconfig-common (>= 0.0.33), php4-mysql, mysql-client, makepasswd, ucf (>= 0.8)
 Recommends: mysql-server
 Description: Automatic configurator for phpbb2 on MySQL database
  Install this package if you don't want to configure phpBB (package: phpbb2)

Modified: trunk/phpbb2/phpbb2-conf-mysql.config
===================================================================
--- trunk/phpbb2/phpbb2-conf-mysql.config	2004-02-06 01:38:32 UTC (rev 48)
+++ trunk/phpbb2/phpbb2-conf-mysql.config	2004-02-08 14:50:39 UTC (rev 49)
@@ -27,82 +27,14 @@
 # so reinjecting and trusting debconf to have unseen the previous question
 # not gonna work -- too bad.
 
-# For now, backing up means starting all over.
-
-if [ -e /etc/phpbb2/config.php ] && [ "$1" = reconfigure ]; then
-	db_reset phpbb2/redodb || true
-	db_input high phpbb2/redodb || true
-	db_go # fail config if cancelling
-	db_get phpbb2/redodb
-	if [ "$RET" = Yes ]; then
-		mv /etc/phpbb2/config.php /etc/phpbb2/config.php.debconf-backup
-	fi
-fi
-
-
 STATE=init
 while [ "$STATE" != "finish" ]; do 
 	case "$STATE" in
-	init)
-		db_input high phpbb2/detail || true
-		db_go # fail config if cancelling
-
-		db_get phpbb2/detail || true
-		DETAIL="$RET"
-		case "$RET" in
-		Custom)	STATE=dbms ;;
-		Manual)	db_input low phpbb2/manual_warning || true
-			if ! db_go; then
-				STATE=init
-			else
-				STATE=finish
-			fi
-			;;
-		Typical)
-			db_reset phpbb2/dbms
-			db_reset phpbb2/dbsetup
-			db_reset phpbb2/dbserver
-			db_reset phpbb2/dbname
-			db_reset phpbb2/dbuser
-			#db_reset phpbb2/dbpass # don't reset, otherwise we forget
-			STATE=dbrootpass
-			;;
-		esac
-		;;
-	dbms)
-		if [ -e /etc/phpbb2/config.php ]; then
-			STATE=finish
-			continue
-		fi
-		db_input high phpbb2/dbms || true
-		if ! db_go; then
-			STATE=init
-			continue
-		fi
-
-		db_get phpbb2/dbms || true
-		if [ ! "$RET" = ODBC ]; then
-			DBMS=MP
-			STATE=dbsetup
-		else
-			DBMS=O
-			STATE=odbc
-		fi
-		;;
-	odbc)
-		db_input medium phpbb2/odbc_warning || true
+	init|dbsetup)
+		db_input high phpbb2-conf-mysql/dbsetup || true
 		db_go
-		STATE=dbinfo
-		;;
-	dbsetup)
-		db_input high phpbb2/dbsetup || true
-		if db_go; then
-			STATE=dbinfo
-		else
-			STATE=init
-		fi
 
-		db_get phpbb2/dbsetup || true
+		db_get phpbb2-conf-mysql/dbsetup || true
 		if [ "$RET" = Populate ] || [ "$RET" = None ]; then
 			DBSETUP=PN
 		else
@@ -110,12 +42,12 @@
 		fi
 		;;
 	dbinfo)
-		db_input high phpbb2/dbserver   || true
-		db_input high phpbb2/dbname   || true
-		db_input high phpbb2/dbuser   || true
-		db_input medium phpbb2/dbpass || true
+		db_input medium   phpbb2-conf-mysql/dbserver || true
+		db_input medium   phpbb2-conf-mysql/dbname   || true
+		db_input medium   phpbb2-conf-mysql/dbuser   || true
+		db_input low      phpbb2-conf-mysql/dbpass   || true
 		if db_go; then
-			if [ "$DBSETUP" = C ] && [ "$DBMS" = MP ]; then
+			if [ "$DBSETUP" = C ]; then
 				STATE=dbrootpass
 			else
 				STATE=finish
@@ -123,22 +55,18 @@
 		else
 			STATE=init
 		fi
-		db_get phpbb2/dbpass
+		db_get phpbb2-conf-mysql/dbpass
 		if [ -z "$RET" ]; then
-			db_set phpbb2/dbpass "`makepasswd --chars 12`"
+			db_set phpbb2-conf-mysql/dbpass "`makepasswd --chars 12`"
 		fi
 		;;
 	dbrootpass)
-#		if [ -e /etc/phpbb2/config.php ]; then
-#			STATE=finish
-#			continue
-#		fi
-		db_get phpbb2/db_created
+		db_get phpbb2-conf-mysql/db_created
 		if [ "$RET" = "true" ]; then
 			STATE=finish
 			break
 		fi
-		db_input high phpbb2/dbrootpass || true
+		db_input high phpbb2-conf-mysql/dbrootpass || true
 		if db_go; then
 			STATE=finish
 		else

Modified: trunk/phpbb2/phpbb2-conf-mysql.postinst
===================================================================
--- trunk/phpbb2/phpbb2-conf-mysql.postinst	2004-02-06 01:38:32 UTC (rev 48)
+++ trunk/phpbb2/phpbb2-conf-mysql.postinst	2004-02-08 14:50:39 UTC (rev 49)
@@ -10,17 +10,24 @@
 
 db_version 2.0
 
-for i in setup ms server name user pass rootpass; do
+for i in setup server name user pass pass_generated rootpass; do
 	db_get phpbb2-conf-mysql/db$i || true
 	eval db$i'="$RET"'
 done
 
+if [ -z "$dbpass" ]; then
+	if [ -z "$dbpass_generated" ]; then
+		dbpass="`makepasswd --chars 12`"
+		db_set phpbb2-conf-mysql/dbpass_generated $dbpass
+	else
+		dbpass="$dbpass_generated"
+	fi
+fi
 
-db_get phpbb2-conf-mysql/detail || true
 # Just to allow breaking out of DB config:
 while true; do
 #
-if [ "$RET" != Manual ]; then
+
 	db_get phpbb2-conf-mysql/db_created
 	if [ "$dbsetup" = Create ] && [ "$RET" != true ]; then
 			dbadmin=root
@@ -78,6 +85,7 @@
 				break 2
 				;;
 			nothing|exec)
+				# this is the table layout version, manually updated
 				db_set phpbb2-conf-mysql/db_version 2.0.6c-1
 				;;
 			*)
@@ -87,9 +95,6 @@
 			esac
 	fi
 			
-	
-fi
-
 # end for allowing breaking out of DB config
 break
 done
@@ -97,28 +102,21 @@
 # purge database rootpassword
 db_reset phpbb2-conf-mysql/dbrootpass
 
-# Install template if configfile doesn't exist yet
-if [ ! -e /etc/phpbb2/config.php ]; then
+# Install/update config file
 	echo "Creating config file..."
-	tmpfile=`mktemp /etc/phpbb2/config.php.XXXXXX`
+	tmpfile=`mktemp /tmp/phpbb2.config.php.XXXXXX`
 
 	cat <<-NEWCONFIG > $tmpfile
 	<?php
 	// Database configuration file for phpbb2. This file is automatically
-	// generated by debconf on `date -R`
+	// generated by phpbb2-conf-mysql on `date -R`
 	
 	/*
-		IMPORTANT:
+		Please use \`dpkg-reconfigure phpbb2-conf-mysql' if you want to modify
+		these variables, or deinstall phpbb2-conf-mysql altogether.
 
-		In order for automated upgrades in the future to work, you MUST
-		use \`dpkg-reconfigure phpbb2-conf-mysql' for changes to the values in
-		this file. Choose \`Custom' setup, and you will be asked for
-		each of the below parameters.
-
-		If you DO change this file, debconf will not overwrite your
-		changes of course, but you possibly need to upgrade the table
-		definitions by hand then.
-
+		Only this way phpbb2-conf-mysql can upgrade your table definitions
+		when needed.
 	*/
 
 	\$dbms         = "mysql";
@@ -135,8 +133,8 @@
 	?>
 	NEWCONFIG
 
-	mv $tmpfile /etc/phpbb2/config.php
-fi
+	ucf --three-way $tmpfile /etc/phpbb2/config.php
+	rm -f $tmpfile
 
 # fix permissions
 chgrp www-data /etc/phpbb2/config.php

Modified: trunk/phpbb2/phpbb2-conf-mysql.templates
===================================================================
--- trunk/phpbb2/phpbb2-conf-mysql.templates	2004-02-06 01:38:32 UTC (rev 48)
+++ trunk/phpbb2/phpbb2-conf-mysql.templates	2004-02-08 14:50:39 UTC (rev 49)
@@ -49,6 +49,14 @@
  .
  Leave this empty if you want to have a random password generated.
 
+Template: phpbb2-conf-mysql/dbpass_generated
+Type: password
+Description: [Internal] makepasswd generated password
+ No need to translate this.
+ .
+ Here the password generated by makepasswd is stored for later reference (for
+ example, on upgrade). Only used if dbpass is empty.
+
 Template: phpbb2-conf-mysql/dbrootpass
 Type: password
 Description: What is the database-administrator password?

Modified: trunk/phpbb2/phpbb2.config
===================================================================
--- trunk/phpbb2/phpbb2.config	2004-02-06 01:38:32 UTC (rev 48)
+++ trunk/phpbb2/phpbb2.config	2004-02-08 14:50:39 UTC (rev 49)
@@ -8,6 +8,6 @@
 
 db_version 2.0
 
-db_input high phpbb2/httpd || true
+db_input medium phpbb2/httpd || true
 db_go
 





More information about the phpBB-l mailing list