From 535d7cce646330e1b86d8aa883b3a7bf258a61c8 Mon Sep 17 00:00:00 2001 From: BenoitCier Date: Wed, 31 Mar 2021 15:53:48 +0200 Subject: [PATCH] fix bug upgrade old version --- scripts/upgrade | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e7bcd58..3feee95 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,16 +24,14 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION #================================================= -if ynh_compare_current_package_version --comparison lt --version 0.8.5~ynh1; then - upgrade_type="0.8.5" + +if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then + upgrade_type="0.9.8" else - if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then - upgrade_type="0.9.8" - else - upgrade_type=$(ynh_check_app_version_changed) - fi + upgrade_type=$(ynh_check_app_version_changed) fi + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -75,26 +73,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# UPGRADE TO 0.8.5 if necessary -#================================================= - -if [ "$upgrade_type" == "0.8.5" ] -then - ynh_script_progression --message="Upgrading upgrade to 0.8.5" --weight=5 - # Download, check integrity, uncompress and patch the source from 0.8.5.src - ynh_setup_source --dest_dir="$final_path" --source_id="0.8.5" - # Set permissions on app files - chown $app:$app $final_path -R - chmod 755 $final_path -R - ynh_add_nginx_config - ynh_add_fpm_config --package="$extra_php_dependencies" - phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - ynh_systemd_action --service_name=nginx --action=reload - #finalyse upgrade - ynh_local_curl "index.php" - upgrade_type="0.9.8" -fi #================================================= # UPGRADE TO 0.9.8 if necessary @@ -118,6 +96,7 @@ then ynh_local_curl "/index.php" upgrade_type="UPGRADE_APP" fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================