From 00bcdc08a6f0d2756bbe58e81e5edcd276bc81b2 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Wed, 8 May 2019 14:37:38 +0200 Subject: [PATCH] Remove broken automated upgrade method This method does not fit anymore with last version. Must be changed --- scripts/_common.sh | 26 -------------------------- scripts/upgrade | 7 ------- 2 files changed, 33 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 4718616..f0851b0 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -11,32 +11,6 @@ # 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 - -# 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 ~ynh -# 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*/}" } #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a4632d4..f35a96b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,9 +23,6 @@ is_public=$(ynh_app_setting_get $app is_public) final_path=$(ynh_app_setting_get $app final_path) db_name=$(ynh_app_setting_get $app db_name) -# Exerimental helper, see "_common.sh" -upstream_version=$(ynh_app_upstream_version) - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -122,10 +119,6 @@ ynh_add_fpm_config # If missing, Cheky is stuck in an "upgrade" state and the config file # needs to be edited with latest version # 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