[phpBB] svn: r28 - trunk/phpbb2

jeroen at wolffelaar.nl jeroen at wolffelaar.nl
Mon Feb 2 13:47:01 CET 2004


Author: jeroen
Date: 2004-02-02 13:40:54 +0100 (Mon, 02 Feb 2004)
New Revision: 28

Modified:
   trunk/phpbb2/config
   trunk/phpbb2/postinst
Log:
- Be a little bit more verbose in postinst
- Fix thinko about when to populate
- Fix tempfilename generation
- Fix flow in config to ask for DB root passwd even (especially) doing Typical
- Make sure it is re-asked wether to overwrite old config


Modified: trunk/phpbb2/config
===================================================================
--- trunk/phpbb2/config	2004-01-31 02:36:52 UTC (rev 27)
+++ trunk/phpbb2/config	2004-02-02 12:40:54 UTC (rev 28)
@@ -31,6 +31,7 @@
 # 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
@@ -126,10 +127,10 @@
 		fi
 		;;
 	dbrootpass)
-		if [ -e /etc/phpbb2/config.php ]; then
-			STATE=httpd
-			continue
-		fi
+#		if [ -e /etc/phpbb2/config.php ]; then
+#			STATE=httpd
+#			continue
+#		fi
 		db_input high phpbb2/dbrootpass || true
 		if db_go; then
 			STATE=httpd

Modified: trunk/phpbb2/postinst
===================================================================
--- trunk/phpbb2/postinst	2004-01-31 02:36:52 UTC (rev 27)
+++ trunk/phpbb2/postinst	2004-02-02 12:40:54 UTC (rev 28)
@@ -25,6 +25,7 @@
 		if [ "$dbms" = MySQL ]; then
 			dbadmin=root
 			dbadmpass="$dbrootpass"
+			echo "Creating MySQL database..."
 			. /usr/share/wwwconfig-common/mysql-createdb.sh
 			if [ "$status" = "error" ]; then
 				db_reset phpbb2/dbfailcreate
@@ -37,6 +38,7 @@
 			if [ "$dbserver" != localhost ]; then
 				dballow=%
 			fi
+			echo "Creating MySQL user..."
 			. /usr/share/wwwconfig-common/mysql-createuser.sh 
 			if [ "$status" = "error" ]; then
 				db_reset phpbb2/dbfailcreateuser
@@ -45,6 +47,7 @@
 				db_go || true
 			fi
 		elif [ "$dbms" = PostgreSQL ]; then
+			echo "Creating PostgreSQL database..."
 			. /usr/share/wwwconfig-common/pgsql-createdb.sh 
 			if [ "$status" = "error" ]; then
 				db_reset phpbb2/dbfailcreate
@@ -54,16 +57,17 @@
 			fi
 		fi
 	fi
-	if [ "$dbsetup" = Populate ]; then
+	if [ "$dbsetup" = Populate ] || [ "$dbsetup" = Create ]; then
 		if [ "$dbms" = MySQL ]; then
 			dbadmin=root
 			dbadmpass="$dbrootpass"
 			statement='SELECT * FROM phpbb_config WHERE config_id'
-			sqlfile=`mktemp /tmp/phpbb2.schema`
+			sqlfile=`mktemp -t phpbb2.schema.XXXXXX`
 			zcat /usr/share/doc/phpbb2/schemas/mysql_schema.sql.gz \
 				> $sqlfile
 			zcat /usr/share/doc/phpbb2/schemas/mysql_basic.sql.gz \
 				>> $sqlfile
+			echo "Creating MySQL tables..."
 			. /usr/share/wwwconfig-common/mysql-ifnot-exec.sh
 			rm -f $sqlfile
 			if [ "$error" != "" ]; then
@@ -103,6 +107,7 @@
 
 # Install template if configfile doesn't exist yet
 if [ ! -e /etc/phpbb2/config.php ]; then
+	echo "Creating config file..."
 	tmpfile=`mktemp /etc/phpbb2/config.php.XXXXXX`
 
 	cat <<-NEWCONFIG > $tmpfile
@@ -152,7 +157,7 @@
 for webserver in $webservers; do
 	websever=${webserver%,}
 	mkdir -p /etc/$webserver/conf.d
-	if [ ! -e /etc/$webserver/phpbb2 ]; then
+	if [ -e /etc/$webserver/httpd.conf ] && [ ! -e /etc/$webserver/phpbb2 ]; then
 		ln -sf /etc/phpbb2/apache.conf /etc/$webserver/phpbb2
 	fi
 done





More information about the phpBB-l mailing list