Browse Source

Don't store packages in settings

Kayou 6 years ago
parent
commit
b3ed0f43af
3 changed files with 7 additions and 12 deletions
  1. 0 1
      scripts/install
  2. 1 0
      scripts/remove
  3. 6 11
      scripts/upgrade

+ 0 - 1
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

+ 1 - 0
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
 

+ 6 - 11
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"
 
 #=================================================