From 73c6ca952893ee1e691a6f850a6290fee15c8ef6 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 18 Feb 2011 21:05:18 +0000 Subject: [PATCH] Use dbconfig-common to force some upgrade commands using some ugly hacks. This should fix any remaining problems with MySQL upgrade. Closes: #613586. --- debian/changelog | 7 +++++-- debian/roundcube-core.postinst | 32 +++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 442433e..947a76d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,11 @@ -roundcube (0.5.1+dfsg-3) UNRELEASED; urgency=low +roundcube (0.5.1+dfsg-3) unstable; urgency=low * Install show_additional_headers plugin in roundcube-plugins package. + * Use dbconfig-common to force some upgrade commands using some ugly + hacks. This should fix any remaining problems with MySQL + upgrade. Closes: #613586. - -- Vincent Bernat Thu, 17 Feb 2011 19:14:50 +0100 + -- Vincent Bernat Fri, 18 Feb 2011 22:04:12 +0100 roundcube (0.5.1+dfsg-2) unstable; urgency=low diff --git a/debian/roundcube-core.postinst b/debian/roundcube-core.postinst index 64bdf5d..59f85f7 100644 --- a/debian/roundcube-core.postinst +++ b/debian/roundcube-core.postinst @@ -39,21 +39,31 @@ apache_install() { case "$1" in configure) - # We try to fix an incomplete upgrade (see #610725) + # We try to fix an incomplete upgrade (see #610725 and #613586) if [ -n "$2" ] && dpkg --compare-versions "$2" le 0.5.1+dfsg-2; then db_get roundcube/dbconfig-upgrade || true if [ x"$RET" = x"true" ]; then - # Ok, we may need to do some upgrade steps. Let's get - # database parameters - eval `sed -n 's/^\$\(.*\);$/\1/p' /etc/roundcube/debian-db.php` - if [ x"$dbtype" = x"mysql" ]; then - echo "Fixing MySQL indexes (you can ignore errors)..." - MYSQLARGS="-f -u $dbuser -p$dbpass $dbname" - [ -z "$dbserver" ] || MYSQLARGS="-h $dbserver $MYSQLARGS" - [ -z "$dbport" ] || MYSQLARGS="-P $dbport $MYSQLARGS" - cat < "$workdir/mysql" +#!/bin/sh +"$real_mysql" "\$@" -f +EOF + chmod +x "$workdir/mysql" + PATH="$workdir:$PATH" + dbc_mysql_exec_file \ + /usr/share/dbconfig-common/data/roundcube/upgrade/mysql/0.5-1 || true + PATH="$oldpath" + rm -rf "$workdir" + fi + cat <