mirror of
https://github.com/YunoHost-Apps/cheky_ynh.git
synced 2024-09-03 18:16:00 +02:00
Remove broken automated upgrade method
This method does not fit anymore with last version. Must be changed
This commit is contained in:
parent
11c21bc7f9
commit
00bcdc08a6
2 changed files with 0 additions and 33 deletions
|
@ -11,32 +11,6 @@
|
||||||
# Taken from https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_read_manifest/ynh_read_manifest_2#L14-L28
|
# Taken from https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_read_manifest/ynh_read_manifest_2#L14-L28
|
||||||
# Idea from https://forum.yunohost.org/t/upgrade-script-how-to-modify-parameter-inside-configuration-file/5352/2
|
# Idea from https://forum.yunohost.org/t/upgrade-script-how-to-modify-parameter-inside-configuration-file/5352/2
|
||||||
|
|
||||||
|
|
||||||
# Read the value of a key in a ynh manifest file
|
|
||||||
#
|
|
||||||
# usage: ynh_read_manifest manifest key
|
|
||||||
# | arg: manifest - Path of the manifest to read
|
|
||||||
# | arg: key - Name of the key to find
|
|
||||||
ynh_read_manifest () {
|
|
||||||
manifest="$1"
|
|
||||||
key="$2"
|
|
||||||
python3 -c "import sys, json;print(json.load(open('$manifest', encoding='utf-8'))['$key'])"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Read the upstream version from the manifest
|
|
||||||
# The version number in the manifest is defined by <upstreamversion>~ynh<packageversion>
|
|
||||||
# For example : 4.3-2~ynh3
|
|
||||||
# This include the number before ~ynh
|
|
||||||
# In the last example it return 4.3-2
|
|
||||||
#
|
|
||||||
# usage: ynh_app_upstream_version
|
|
||||||
ynh_app_upstream_version () {
|
|
||||||
manifest_path="../manifest.json"
|
|
||||||
if [ ! -e "$manifest_path" ]; then
|
|
||||||
manifest_path="../settings/manifest.json" # Into the restore script, the manifest is not at the same place
|
|
||||||
fi
|
|
||||||
version_key=$(ynh_read_manifest "$manifest_path" "version")
|
|
||||||
echo "${version_key/~ynh*/}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -23,9 +23,6 @@ is_public=$(ynh_app_setting_get $app is_public)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
db_name=$(ynh_app_setting_get $app db_name)
|
||||||
|
|
||||||
# Exerimental helper, see "_common.sh"
|
|
||||||
upstream_version=$(ynh_app_upstream_version)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -122,10 +119,6 @@ ynh_add_fpm_config
|
||||||
# If missing, Cheky is stuck in an "upgrade" state and the config file
|
# If missing, Cheky is stuck in an "upgrade" state and the config file
|
||||||
# needs to be edited with latest version
|
# needs to be edited with latest version
|
||||||
# Also avoid to make file "$final_path/version.php" writable
|
# Also avoid to make file "$final_path/version.php" writable
|
||||||
if [ -f "$final_path/var/config.ini" ]; then
|
|
||||||
# Change the existing version by the new one taken from the app manifest
|
|
||||||
ynh_replace_string "^version =.*" "version = \"$upstream_version\"" "$final_path/var/config.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
Loading…
Reference in a new issue