[phpBB] svn: r51 - trunk/phpbb2

jeroen at wolffelaar.nl jeroen at wolffelaar.nl
Sun Feb 8 17:18:02 CET 2004


Author: jeroen
Date: 2004-02-08 17:17:06 +0100 (Sun, 08 Feb 2004)
New Revision: 51

Added:
   trunk/phpbb2/mysql-ifnot-exec.sh
   trunk/phpbb2/phpbb2-conf-mysql.install
Modified:
   trunk/phpbb2/TODO
   trunk/phpbb2/changelog
   trunk/phpbb2/phpbb2-conf-mysql.config
   trunk/phpbb2/phpbb2-conf-mysql.postinst
Log:
Fix loop in debconf question asking, fix table creation


Modified: trunk/phpbb2/TODO
===================================================================
--- trunk/phpbb2/TODO	2004-02-08 15:31:03 UTC (rev 50)
+++ trunk/phpbb2/TODO	2004-02-08 16:17:06 UTC (rev 51)
@@ -12,6 +12,7 @@
 --Jeroen
 
 Normal TODO's:
+- Set board creation date on first access if it is still 1970 or so
 - Multiboard security okay? Yes.
 - PostgreSQL setup
 - Purge user on package purge (but not DB, or ask about DB, do note about that)
@@ -23,13 +24,13 @@
 - Make some way of getting the admin password to be known (preferably without
   using debconf)
 - What's the doc-base stuff... probably need to do something with it?
-- In PostgreSQL, what is the root account normally called (for in README.Debian)
 - Translations: Translaters can ask subversion access, so they can check in
   translations themselves.
-- Debconf hss half-baken support for backup... workaround someday/write a patch
-- If manual config, note so in generated config.php
+- Debconf has half-baken support for backup... workaround someday/write a patch
+- Have #231186 fixed, and remove the workaround in this package
 
 Possible enhancements:
 - Have admin choose the database prefix - is this useful? Will only do it if
   requested, because I don't think so
-- Rename config.php to database.php, which is more appropriate?
+- Rename config.php to database.php, which is more appropriate? Upstream calls
+  it config.php

Modified: trunk/phpbb2/changelog
===================================================================
--- trunk/phpbb2/changelog	2004-02-08 15:31:03 UTC (rev 50)
+++ trunk/phpbb2/changelog	2004-02-08 16:17:06 UTC (rev 51)
@@ -2,5 +2,5 @@
 
   * Initial Release.
 
- -- Jeroen van Wolffelaar <jeroen at wolffelaar.nl>  Thu,  5 Feb 2004 03:02:46 +0100
+ -- Jeroen van Wolffelaar <jeroen at wolffelaar.nl>  Sun,  8 Feb 2004 16:42:46 +0100
 

Added: trunk/phpbb2/mysql-ifnot-exec.sh
===================================================================
--- trunk/phpbb2/mysql-ifnot-exec.sh	2004-02-08 15:31:03 UTC (rev 50)
+++ trunk/phpbb2/mysql-ifnot-exec.sh	2004-02-08 16:17:06 UTC (rev 51)
@@ -0,0 +1,63 @@
+#!/bin/sh
+# File:		mysql-if-exec.sh
+# Changes:
+#	20010322 Ola Lundqvist <opal at debian.org>
+#	20011022 Luca De Vitis <luca at debian.org>
+#		Introduced the error variable.
+#	20020116 Ola Lundqvist <opal at debian.org>
+#		Documented the error variable.
+#	20020125 Ola Lundqvist <opal at debian.org>
+#		Removed the dbadmpass check part.
+#	20020125 Ola Lundqvist <opal at debian.org>
+#		Added new status code.
+#	20031219 Thomas Viehmann <tv at beamnet.de>
+#		Patch to use eval in order to not break.
+#	20040205 Jeroen van Wolffelaar <jeroen at wolffelaar.nl>
+#		Relax access check to work for non-root users too
+# Needs:	$dbname    - the database that user should have access to (optional)
+#		$dbserver  - the server to connect to.
+#		$dbadmin   - the administrator name.
+#		$dbadmpass - the administrator password.
+#		$statement - the statement to test if it can get data.
+#		which
+#		mysql
+#		/usr/share/wwwconfig-coomon/mysql.get
+# Description:	First checks a statement. If that statement is not ok it executes the
+#		script.
+# Sets:		$status = {error, nothing, exec, execerror}
+#		$error = error message (if $status = error)
+
+status=error
+error=""
+
+. /usr/share/wwwconfig-common/mysql.get
+
+if [ -z "$dbserver" ] ; then
+    error="No database server specified."
+elif [ -z "$dbadmin" ] ; then
+    error="No database administrator specified."
+elif [ -z "$statement" ] ; then
+    error="No statement to test for."
+elif [ -z "$sqlfile" ] ; then
+    error="No sqlfile to execute."
+elif [ ! -e "$sqlfile" ] ; then
+    error="Sqlfile $sqlfile not found."
+elif [ ! -x $(which mysql) ] ; then
+    error="No mysql client to execute, install the mysql client package and
+    run 'dpkg-reconfigure -plow packagename'."
+elif ! eval $mysqlcmd </dev/null >/dev/null 2>&1 ; then
+    error="Error when trying to connect to the mysql database.
+    This error can occur if you have no database to connect to, or
+    if the password was incorrect.
+	use: dpkg-reconfigure -plow packagename to reconfigure."
+elif ! eval $mysqlcmd -f $dbname -e "\"$statement\"" >/dev/null 2>&1 ; then
+    log="${log}Executing command to mysql."
+    if eval $mysqlcmd -f $dbname < $sqlfile > /dev/null 2>&1 ; then
+	status=exec
+    else
+	status=execerror
+	error="Unable to run the sql script ($sqlfile)."
+    fi
+else
+    status=nothing
+fi


Property changes on: trunk/phpbb2/mysql-ifnot-exec.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/phpbb2/phpbb2-conf-mysql.config
===================================================================
--- trunk/phpbb2/phpbb2-conf-mysql.config	2004-02-08 15:31:03 UTC (rev 50)
+++ trunk/phpbb2/phpbb2-conf-mysql.config	2004-02-08 16:17:06 UTC (rev 51)
@@ -40,6 +40,7 @@
 		else
 			DBSETUP=C
 		fi
+		STATE=dbinfo
 		;;
 	dbinfo)
 		db_input medium   phpbb2-conf-mysql/dbserver || true

Added: trunk/phpbb2/phpbb2-conf-mysql.install
===================================================================
--- trunk/phpbb2/phpbb2-conf-mysql.install	2004-02-08 15:31:03 UTC (rev 50)
+++ trunk/phpbb2/phpbb2-conf-mysql.install	2004-02-08 16:17:06 UTC (rev 51)
@@ -0,0 +1 @@
+debian/mysql-ifnot-exec.sh /usr/share/phpbb2-conf-mysql

Modified: trunk/phpbb2/phpbb2-conf-mysql.postinst
===================================================================
--- trunk/phpbb2/phpbb2-conf-mysql.postinst	2004-02-08 15:31:03 UTC (rev 50)
+++ trunk/phpbb2/phpbb2-conf-mysql.postinst	2004-02-08 16:17:06 UTC (rev 51)
@@ -69,12 +69,12 @@
 			dbadmpass="$dbpass"
 			statement='SELECT * FROM phpbb_config"'
 			sqlfile=`mktemp -t phpbb2-conf-mysql.schema.XXXXXX`
-			zcat /usr/share/doc/phpbb2-conf-mysql/schemas/mysql_schema.sql.gz \
+			zcat /usr/share/doc/phpbb2/schemas/mysql_schema.sql.gz \
 				> $sqlfile
-			zcat /usr/share/doc/phpbb2-conf-mysql/schemas/mysql_basic.sql.gz \
+			zcat /usr/share/doc/phpbb2/schemas/mysql_basic.sql.gz \
 				>> $sqlfile
 			echo "Creating MySQL tables if they don't exist yet..."
-			. /usr/share/wwwconfig-common/mysql-ifnot-exec.sh
+			. /usr/share/phpbb2-conf-mysql/mysql-ifnot-exec.sh
 			rm -f $sqlfile
 			case "$status" in
 			*error)
@@ -121,7 +121,7 @@
 
 	\$dbms         = "mysql";
 
-	\$dbhost       = "$dbhost";
+	\$dbhost       = "$dbserver";
 	\$dbname       = "$dbname";
 	\$dbuser       = "$dbuser";
 	\$dbpasswd     = "$dbpass";





More information about the phpBB-l mailing list