From ad4ea9d6e77c026d2036c7c393c2603135aa56b3 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sun, 14 Jun 2020 15:23:34 +0200 Subject: [PATCH] Fix upgrade for first major versions --- scripts/upgrade | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5d832b6..8054652 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -247,17 +247,19 @@ then major_version=${last_version%%.*} current_major_version=${current_version%%.*} + # Load the value for this version + source upgrade.d/upgrade.$current_major_version.sh + # If the current version has the same major version than the next one, # then it's the last upgrade to do - if [ "$major_version" -eq "$current_major_version" ]; then + # We also cover the case where the last version is the first of the current major version series + # (e.g. 19.0.0 is the latest version) + if [[ ("$major_version" -eq "$current_major_version") || ( ("$major_version" -eq "$((current_major_version+1))") && ("$next_version" == "$last_version") ) ]]; then current_major_version=last # Execute the commands dedicated to the last upgrade last_upgrade_operations fi - # Load the value for this version - source upgrade.d/upgrade.$current_major_version.sh - ynh_print_info --message="Upgrade to nextcloud $next_version" # Create an app.src for this version of nextcloud