[phpBB] svn: r380 - trunk/phpbb2

kink at wolffelaar.nl kink at wolffelaar.nl
Thu May 31 19:03:53 CEST 2007


Author: kink
Date: 2007-05-31 19:03:52 +0200 (Thu, 31 May 2007)
New Revision: 380

Modified:
   trunk/phpbb2/changelog
   trunk/phpbb2/phpbb2-conf-mysql.postinst
Log:
automatically create the search_time attribute of phpbb_search_results.
In the most ugly way ever.


Modified: trunk/phpbb2/changelog
===================================================================
--- trunk/phpbb2/changelog	2007-05-31 16:52:38 UTC (rev 379)
+++ trunk/phpbb2/changelog	2007-05-31 17:03:52 UTC (rev 380)
@@ -2,9 +2,11 @@
 
   * Reload Apache after we've installed the webserver configuration
     (Closes: #369914).
+  * Install the search_time attribute in phpbb_search_results when it
+    does not exist yet (Closes: #414684, #423798).
   * Install a ranks dir under /var/lib/phpbb2 (Closes: #421392).
 
- -- Thijs Kinkhorst <thijs at debian.org>  Thu, 31 May 2007 18:14:53 +0200
+ -- Thijs Kinkhorst <thijs at debian.org>  Thu, 31 May 2007 19:00:44 +0200
 
 phpbb2 (2.0.22-1) unstable; urgency=low
 

Modified: trunk/phpbb2/phpbb2-conf-mysql.postinst
===================================================================
--- trunk/phpbb2/phpbb2-conf-mysql.postinst	2007-05-31 16:52:38 UTC (rev 379)
+++ trunk/phpbb2/phpbb2-conf-mysql.postinst	2007-05-31 17:03:52 UTC (rev 380)
@@ -123,11 +123,41 @@
 					db_go || true
 					bailout
 					;;
-				exec|nothing)
+				exec)
 					# [nothing] We were already running with the new table,
 					# apparantly, or [exec] at least, we're now
 					db_set phpbb2-conf-mysql/db_version 2.0.18-1
 					;;
+				nothing)
+					# the config table already existed. But maybe we're still
+					# missing the search_time column. Huger code duplication
+					# follows...
+					# This is unbelievable. We need to switch to something better.
+					statement='SELECT search_time FROM phpbb_search_results'
+					sqlfile=`mktemp -t phpbb2-conf-mysql.schema.XXXXXX`
+					echo "ALTER TABLE phpbb_search_results ADD COLUMN search_time INT(11) NOT NULL" > $sqlfile
+					echo "Creating search_time column if it doesn't exist yet..."
+					. /usr/share/wwwconfig-common/mysql-ifnot-exec.sh
+					rm -f $sqlfile
+					case "$status" in
+					*error)
+						db_reset phpbb2-conf-mysql/dbfailcreatetables || true
+						db_subst phpbb2-conf-mysql/dbfailcreatetables error $(echo "$error"|head -1)
+						db_input high phpbb2-conf-mysql/dbfailcreatetables || true
+						db_go || true
+						bailout
+						;;
+					exec|nothing)
+						# [nothing] We were already running with the new table,
+						# apparantly, or [exec] at least, we're now
+						db_set phpbb2-conf-mysql/db_version 2.0.18-1
+						;;
+					*)
+						echo "Unrecognized status from \
+							wwwconfig-common/mysql-ifnot-exec.sh: $status" >&2
+						exit 1
+					esac
+					;;
 				*)
 					echo "Unrecognized status from \
 						wwwconfig-common/mysql-ifnot-exec.sh: $status" >&2





More information about the phpBB-l mailing list