1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/diaspora_ynh.git synced 2024-09-03 18:26:13 +02:00

Fix upgrade

This commit is contained in:
yalh76 2022-06-10 14:15:47 +02:00
parent 36b7c16408
commit 8634fbb413
2 changed files with 8 additions and 10 deletions

View file

@ -9,7 +9,10 @@
setup_root=1
setup_nourl=0
upgrade=1
# 0.7.16.0-ynh1
upgrade=1 from_commit=ee7996edba39c1978b0986aabc89042f949e335f
# 0.7.17.0~ynh1
upgrade=1 from_commit=f6bc22257c54478420ed42480f346f25601ee87a
backup_restore=1
multi_instance=1
port_already_use=0

View file

@ -42,7 +42,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
@ -92,13 +92,9 @@ if gpg --list-keys piotr.kuczynski@gmail.com >/dev/null 2>&1; then
fi
if ! [ -d "$final_path/live" ]; then
ynh_delete_file_checksum --file="$final_path/config/diaspora.yml"
ynh_delete_file_checksum --file="$final_path/config/database.yml"
tmpdir="$(mktemp -d)"
mv "$final_path" "$tmpdir/live"
mkdir -p "$final_path"
mv "$tmpdir/live" "$final_path/live"
ynh_secure_remove --file="$tmpdir"
ynh_delete_file_checksum --file="$final_path/diaspora/config/diaspora.yml"
ynh_delete_file_checksum --file="$final_path/diaspora/config/database.yml"
mv "$final_path/diaspora" "$final_path/live"
ynh_store_file_checksum --file="$final_path/live/config/diaspora.yml"
ynh_store_file_checksum --file="$final_path/live/config/database.yml"
chmod 750 "$final_path"
@ -117,11 +113,10 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path/live" --keep="live/config/diaspora.yml live/config/database.yml"
ynh_setup_source --dest_dir="$final_path/live" --keep="config/diaspora.yml config/database.yml"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"