1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garradin_ynh.git synced 2024-09-03 18:36:17 +02:00

fix bug upgrade old version

This commit is contained in:
BenoitCier 2021-03-31 15:53:48 +02:00
parent 8e8b49f757
commit 535d7cce64

View file

@ -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
#=================================================