From cddc4639f33c96843d860bb78e370c7b51bf6f06 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 13 May 2017 17:32:17 +0100 Subject: [PATCH] Mailpile upgrades --- src/freedombone-app-mailpile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/freedombone-app-mailpile b/src/freedombone-app-mailpile index 558f96b1..29e45755 100755 --- a/src/freedombone-app-mailpile +++ b/src/freedombone-app-mailpile @@ -37,7 +37,7 @@ MAILPILE_DOMAIN_NAME= MAILPILE_CODE= MAILPILE_ONION_PORT=8103 MAILPILE_REPO="https://github.com/mailpile/Mailpile" -MAILPILE_COMMIT='cfd1749a2d073be2903ce947c7cbf59b1e237448' +MAILPILE_COMMIT='6f56fe4ad736c8e385bea658454bed110d08c60d' MAILPILE_PORT=33411 mailpile_variables=(MAILPILE_REPO @@ -83,12 +83,24 @@ function reconfigure_mailpile { function upgrade_mailpile { read_config_param "MAILPILE_DOMAIN_NAME" + upgrade_mp= + CURR_COMMIT=$MAILPILE_COMMIT + if grep -q "mailpile commit" $COMPLETION_FILE; then + CURR_COMMIT=$(get_completion_param "mailpile commit") + fi + if [[ "$CURR_COMMIT" != "$MAILPILE_COMMIT" ]]; then + upgrade_mp=1 + fi + function_check set_repo_commit set_repo_commit /var/www/$MAILPILE_DOMAIN_NAME/mail "mailpile commit" "$MAILPILE_COMMIT" $MAILPILE_REPO - cd /var/www/$MAILPILE_DOMAIN_NAME/mail - pip install -r requirements.txt - chown -R mailpile:mailpile /var/www/$MAILPILE_DOMAIN_NAME/mail + if [ $upgrade_mp ]; then + cd /var/www/$MAILPILE_DOMAIN_NAME/mail + pip install -r requirements.txt + + chown -R mailpile:mailpile /var/www/$MAILPILE_DOMAIN_NAME/mail + fi } function backup_local_mailpile {