From 9ed20af7f3edee790916ea14f1d314930019afc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 26 Jan 2021 22:09:47 +0100 Subject: [PATCH] Fix upgrade regession --- check_process | 4 ++-- manifest.json | 2 +- scripts/install | 2 -- scripts/upgrade | 13 +++++++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/check_process b/check_process index 43bed43..3259076 100644 --- a/check_process +++ b/check_process @@ -19,7 +19,7 @@ upgrade=1 upgrade=1 from_commit=db11d890922564dfdcb7937a3a682957082fbb31 upgrade=1 from_commit=67e0869de25f4f58710c3d30d5533356745ea676 - upgrade=1 from_commit=637a32aa57bc2dc6421e0e79d52862f0924be1cf + upgrade=1 from_commit=6786d9f65e60b2d2a96b9ea4c43897dde3a66199 backup_restore=1 multi_instance=0 wrong_user=1 @@ -36,5 +36,5 @@ name=Version 6.3.4 - branch Old_version_for_CI_3 ; commit=67e0869de25f4f58710c3d30d5533356745ea676 name=Before move main dir to opt - branch Old_version_for_CI_2 - ; commit=637a32aa57bc2dc6421e0e79d52862f0924be1cf + ; commit=6786d9f65e60b2d2a96b9ea4c43897dde3a66199 name=The oldest installable version - branch Old_version_for_CI diff --git a/manifest.json b/manifest.json index 73b386f..afeb0a3 100644 --- a/manifest.json +++ b/manifest.json @@ -23,7 +23,7 @@ "mysql" ], "requirements": { - "yunohost": ">= 4.0" + "yunohost": ">= 4.1" }, "arguments": { "install": [ diff --git a/scripts/install b/scripts/install index a1e2464..190e8e8 100644 --- a/scripts/install +++ b/scripts/install @@ -26,7 +26,6 @@ seafile_data=/home/yunohost.app/seafile-data final_path=/opt/yunohost/$app seafile_user=$app admin_password=$YNH_APP_ARG_ADMIN_PASSWORD -# TODO User env variable in 4.1 seafile_version=$(ynh_app_upstream_version) # Create special path with / at the end @@ -68,7 +67,6 @@ ynh_app_setting_set --app $app --key seahub_port --value $seahub_port ynh_app_setting_set --app $app --key fileserver_port --value $fileserver_port ynh_app_setting_set --app $app --key webdav_port --value $webdav_port ynh_app_setting_set --app $app --key is_public --value $is_public -ynh_app_setting_set --app $app --key installed_version --value $seafile_version #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index beac386..5e2b765 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,16 +19,19 @@ ynh_script_progression --message="Loading installation settings..." # Retrieve arguments domain=$(ynh_app_setting_get --app $app --key domain) path_url=$(ynh_normalize_url_path --path_url $(ynh_app_setting_get --app $app --key path)) -installed_version=$(ynh_app_setting_get --app $app --key installed_version) seahub_port=$(ynh_app_setting_get --app $app --key seahub_port) fileserver_port=$(ynh_app_setting_get --app $app --key fileserver_port) webdav_port=$(ynh_app_setting_get --app $app --key webdav_port) final_path=$(ynh_app_setting_get --app $app --key final_path) seafile_user=$app seafile_data=/home/yunohost.app/seafile-data -# TODO User env variable in 4.1 +installed_version=${YNH_APP_CURRENT_VERSION/*~ynh/} seafile_version=$(ynh_app_upstream_version) +if [ "$YNH_APP_CURRENT_VERSION" == '-' ]; then + YNH_APP_CURRENT_VERSION="6.0.9~ynh0" +fi + ynh_script_progression --message="Stoping services..." # stop seafile server @@ -51,7 +54,8 @@ pkill -f seahub || true ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=30 # Backup the current version of the app -if [ "0$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade)" -ne 1 ] +if [ "0$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade)" -ne 1 ] \ + && (ynh_compare_current_package_version --comparison=ge --version='7.0.5~ynh1') then ynh_backup_before_upgrade ynh_clean_setup () { @@ -315,7 +319,4 @@ do ynh_secure_remove --file=$final_path/$f done -# store new installed version -ynh_app_setting_set --app $app --key installed_version --value $seafile_version - ynh_script_progression --message="Upgrade of $app completed" --last