From b3ed0f43afe459fff720b6843f19509df2dcb08a Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 26 Feb 2019 01:27:39 +0100 Subject: [PATCH] Don't store packages in settings --- scripts/install | 1 - scripts/remove | 1 + scripts/upgrade | 17 ++++++----------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index b621930..57d7702 100644 --- a/scripts/install +++ b/scripts/install @@ -212,7 +212,6 @@ ynh_app_setting_set $app ip4_dns1 80.67.169.12 ynh_app_setting_set $app ip4_nat_prefix 10.0.242 ynh_app_setting_set $app vpnclient no ynh_app_setting_set $app service_name $service_name -ynh_app_setting_set $app packages $packages if [[ -z $wifi_device ]]; then ynh_app_setting_set $app service_enabled 0 diff --git a/scripts/remove b/scripts/remove index 63d80a6..06278fd 100644 --- a/scripts/remove +++ b/scripts/remove @@ -47,6 +47,7 @@ final_path=$(ynh_app_setting_get $app final_path) if yunohost service status $service_name >/dev/null 2>&1 then ynh_print_info "Removing $app service" + yunohost service stop $service_name yunohost service remove $service_name fi diff --git a/scripts/upgrade b/scripts/upgrade index a65191c..3a10f06 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,7 +20,6 @@ domain=$(ynh_app_setting_get $app domain) path_url=$(ynh_app_setting_get $app path) final_path=$(ynh_app_setting_get $app final_path) firmware_nonfree=$(ynh_app_setting_get $app firmware_nonfree) -packages=$(ynh_app_setting_get $app packages) #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -33,16 +32,6 @@ if [ -z $final_path ]; then ynh_app_setting_set $app final_path $final_path fi -if [ -z $packages ]; then - if [[ $firmware_nonfree -eq 1 ]]; then - packages=$nonfree_packages - else - packages=$free_packages - fi - - ynh_app_setting_set $app packages $packages -fi - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -87,6 +76,12 @@ ynh_add_nginx_config #================================================= ynh_print_info "Upgrading dependencies..." +if [[ $firmware_nonfree -eq 1 ]]; then + packages=$nonfree_packages +else + packages=$free_packages +fi + ynh_install_app_dependencies "$pkg_dependencies" "$packages" #=================================================