X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=debian%2Froundcube-core.postinst;h=59f85f727ba009b087ba18dc6b201321ab2c2386;hb=73c6ca952893ee1e691a6f850a6290fee15c8ef6;hp=cb7e507b465c9b46241751f4802f390f360e8994;hpb=7c1332a6ec672413218ff2deb2563287135fd221;p=roundcube.git diff --git a/debian/roundcube-core.postinst b/debian/roundcube-core.postinst index cb7e507..59f85f7 100644 --- a/debian/roundcube-core.postinst +++ b/debian/roundcube-core.postinst @@ -39,6 +39,38 @@ apache_install() { case "$1" in configure) + # 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 + if [ x"$dbc_dbtype" = x"mysql" ]; then + # Ok, we may need to do some upgrade steps. + echo "Fixing MySQL installation..." + if dpkg --compare-versions "$2" ge 0.5; then + # Hack (ugly) to replace "mysql" by "mysql -f" + real_mysql="$(which mysql)" + workdir="$(mktemp -d)" + oldpath="$PATH" + 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 <