mirror of
https://github.com/YunoHost-Apps/galette_ynh.git
synced 2024-09-03 18:36:28 +02:00
Fix upgrade
This commit is contained in:
parent
3a2ad775d9
commit
04b876b35c
1 changed files with 8 additions and 20 deletions
|
@ -54,6 +54,13 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=2
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=2
|
||||||
|
|
||||||
|
# Cleaning legacy permissions
|
||||||
|
if ynh_legacy_permissions_exists; then
|
||||||
|
ynh_legacy_permissions_delete_all
|
||||||
|
|
||||||
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
|
fi
|
||||||
|
|
||||||
# If db_name doesn't exist, create it
|
# If db_name doesn't exist, create it
|
||||||
if [ -z "$db_name" ]; then
|
if [ -z "$db_name" ]; then
|
||||||
db_name=$(ynh_sanitize_dbid "$app")
|
db_name=$(ynh_sanitize_dbid "$app")
|
||||||
|
@ -78,13 +85,6 @@ if [ -z "$database" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=database --value=$database
|
ynh_app_setting_set --app=$app --key=database --value=$database
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cleaning legacy permissions
|
|
||||||
if ynh_legacy_permissions_exists; then
|
|
||||||
ynh_legacy_permissions_delete_all
|
|
||||||
|
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -102,19 +102,7 @@ then
|
||||||
ynh_script_progression --message="Upgrading source files..."
|
ynh_script_progression --message="Upgrading source files..."
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
mv "$final_path" "$final_path.old"
|
ynh_setup_source --dest_dir="$final_path" --keep="galette/config/config.inc.php galette/data/"
|
||||||
|
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
|
||||||
#ynh_secure_remove "$final_path"/tests
|
|
||||||
|
|
||||||
# when running automatic tests, there is no config.inc.php
|
|
||||||
if [ -e "$final_path.old/galette/config/config.inc.php" ]; then
|
|
||||||
cp "$final_path.old/galette/config/config.inc.php" "$final_path/galette/config/config.inc.php"
|
|
||||||
cp -r "$final_path.old/galette/data" "$final_path/galette/data"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# delete temp directory
|
|
||||||
ynh_secure_remove --file="$final_path.old"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
|
|
Loading…
Add table
Reference in a new issue