From 23d2629be9d6edced6a150f8a0f6eb11b004a3ec Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 30 Dec 2020 00:22:48 +0100 Subject: [PATCH 1/2] disable mail app to fix the upgrade from 19 to 20 --- scripts/upgrade | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 12c9b11..9e77108 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -244,6 +244,15 @@ then # Print the current version number of Nextcloud exec_occ -V + # Upgrade may fail if this app is enabled + exec_occ app:list | grep -q -w mail + mail_app_is_active=$? + + # Temporary disable the mail app + if [ $mail_app_is_active -eq 0 ]; then + exec_occ app:disable mail + fi + # While the current version is not the last version, do an upgrade while [ "$last_version" != "$current_version" ] do @@ -346,6 +355,11 @@ then ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$nc_conf" ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$nc_conf" + # Reneable the mail app + if [ $mail_app_is_active -eq 0 ]; then + exec_occ app:enable mail + fi + # Ensure that UpdateNotification app is disabled exec_occ app:disable updatenotification From 1fe41e5570ec4306f1bae8d5a318c46ff292e246 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 31 Dec 2020 00:59:45 +0100 Subject: [PATCH 2/2] Fix detection of mail app enabled --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9e77108..e2d1b8c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -245,7 +245,8 @@ then exec_occ -V # Upgrade may fail if this app is enabled - exec_occ app:list | grep -q -w mail + # Take all apps enabled, and check if mail is one of them + exec_occ app:list | awk '/Enabled/{f=1;next} /Disabled/{f=0} f' | grep -q -w mail mail_app_is_active=$? # Temporary disable the mail app