X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=debian%2Fpostinst;h=80b0827a4ef5e0641a2f7f43a09e5a09d9991b10;hb=a81bad40bfad52e3fde5512f2017d256c495a4b3;hp=b7996ffe1a728d09e08f6e806649b7b718b7ddb3;hpb=8cef237ae639ac176c8296788ce7763ed6cbbc91;p=roundcube.git diff --git a/debian/postinst b/debian/postinst index b7996ff..80b0827 100644 --- a/debian/postinst +++ b/debian/postinst @@ -20,6 +20,58 @@ dbc_go roundcube $@ case "$1" in configure) + # From 0.1-beta2.2 to 0.1-rc1, a column was added to table + # `identities'. For MySQL and PostgreSQL, this is handled by + # dbconfig-common but for sqlite, there is no way to add a + # column to a table. Therefore, we dump here the table and add + # the column. + [ "$dbc_upgrade" = "true" ] && { + case "$dbc_dbtype" in + sqlite) + db="${dbc_basepath}/${dbc_dbname}" + # OK, we need to check if the table contains html_signature + if ! sqlite "$db" '.schema identities' | grep -q html_signature; then + # We need to add it + echo -n "Need to upgrade 'identities' table in $db... " + upgrade_tmp=$(mktemp -t roundcube.sqlite.XXXXXXXXXX) + ( + cat < $upgrade_tmp + sqlite "$db" < $upgrade_tmp + rm $upgrade_tmp + echo "OK" + fi + ;; + *) + # Do nothing + ;; + esac + } + CONFFILE=/etc/roundcube/main.inc.php touch $CONFFILE.ucftmp chmod 640 $CONFFILE.ucftmp