1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/webtrees_ynh.git synced 2024-09-03 18:26:37 +02:00
This commit is contained in:
ericgaspar 2021-11-16 20:25:58 +01:00
parent 7f00fcca94
commit d3de670d27
3 changed files with 35 additions and 26 deletions

View file

@ -1,6 +1,5 @@
SOURCE_URL=https://github.com/fisharebest/webtrees/releases/download/2.0.16/webtrees-2.0.16.zip SOURCE_URL=https://github.com/fisharebest/webtrees/releases/download/2.0.17/webtrees-2.0.17.zip
SOURCE_SUM=c9327e92df83b3ccfa73d4a5c963357ab25be7daa471fa4ecb157f06b9615366 SOURCE_SUM=cf354f7fff855881bc9647b98a517654ded5a780d5f09737bc2bef17e1cccd71
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=

View file

@ -6,7 +6,7 @@
"en": "Web-based genealogy application", "en": "Web-based genealogy application",
"fr": "Logiciel libre de généalogie en ligne" "fr": "Logiciel libre de généalogie en ligne"
}, },
"version":"2.0.16~ynh1", "version":"2.0.17~ynh1",
"url": "https://www.webtrees.net", "url": "https://www.webtrees.net",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"maintainer": { "maintainer": {

View file

@ -21,6 +21,26 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up $app before upgrading (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
@ -45,20 +65,6 @@ if ynh_legacy_permissions_exists; then
ynh_app_setting_delete --app=$app --key=is_public ynh_app_setting_delete --app=$app --key=is_public
fi fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up $app before upgrading (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
@ -74,17 +80,21 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." ynh_script_progression --message="Upgrading source files..."
# Move old app dir if [ "$upgrade_type" == "UPGRADE_APP" ]
mv ${final_path} ${final_path}.old then
ynh_script_progression --message="Upgrading source files..."
# Move old app dir
mv ${final_path} ${final_path}.old
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path" ynh_setup_source "$final_path"
# restore data # restore data
cp -a ${final_path}.old/data ${final_path} cp -a ${final_path}.old/data ${final_path}
# delete temp directory # delete temp directory
ynh_secure_remove --file=${final_path}.old ynh_secure_remove --file=${final_path}.old
fi
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R 700 $final_path/data chmod -R 700 $final_path/data