X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=debian%2Froundcube-core.postinst;h=59f85f727ba009b087ba18dc6b201321ab2c2386;hb=73c6ca952893ee1e691a6f850a6290fee15c8ef6;hp=5db3c4b328da05b4862d0fe4cf9f1edd4760b7da;hpb=685987db93fe029d5b7059a253b6dfcda976209c;p=roundcube.git diff --git a/debian/roundcube-core.postinst b/debian/roundcube-core.postinst index 5db3c4b..59f85f7 100644 --- a/debian/roundcube-core.postinst +++ b/debian/roundcube-core.postinst @@ -9,7 +9,7 @@ set -e . /usr/share/dbconfig-common/dpkg/postinst dbc_generate_include=php:/etc/roundcube/debian-db.php dbc_generate_include_owner="www-data:www-data" -dbc_generate_include_perms="660" +dbc_generate_include_perms="640" dbc_dbfile_owner="www-data:www-data" dbc_dbfile_perms="0660" dbc_dbuser=roundcube @@ -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 <> $CONFFILE.ucftmp + -e "s+^\(\$rcmail_config\['language'\] = \).*\(;\)\$+\1'${language}'\2+" >> $CONFFILE.ucftmp ucf --debconf-ok $CONFFILE.ucftmp $CONFFILE chown root:www-data $CONFFILE @@ -113,7 +145,6 @@ case "$1" in chmod -R 750 /var/log/roundcube chown -R www-data:www-data /var/lib/roundcube/temp chmod -R 750 /var/lib/roundcube/temp - chown www-data:adm /var/lib/roundcube/skins ;;