1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garradin_ynh.git synced 2024-09-03 18:36:17 +02:00

Use ynh_install_app_dependencies for cleaner installation / removal

Also don't output warning about package not being found on removal
it is a normal case: running ynh_remove_app_dependencies produces it
This commit is contained in:
Florent 2021-12-30 07:31:27 +01:00 committed by Florent F
parent 3d4f19bc77
commit 2e7cced587
3 changed files with 13 additions and 6 deletions

View file

@ -76,7 +76,8 @@ ynh_add_nginx_config
ynh_script_progression --message="Configuring PHP-FPM..." --weight=5
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies"
ynh_install_app_dependencies "$extra_php_dependencies"
ynh_add_fpm_config
#=================================================
# ADD A CONFIGURATION

View file

@ -41,10 +41,13 @@ ynh_remove_nginx_config
ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2
# Remove the app dependencies installed along with php-fpm
# ynh_remove_app_dependencies
ynh_remove_app_dependencies
# Remove the dedicated PHP-FPM config
ynh_remove_fpm_config --package="$extra_php_dependencies"
# NB: If there is a warning because it cannot locate the garradin-ynh-deps package, ignore
# It's just it has been removed before.
# https://github.com/YunoHost/yunohost/blob/509ba1e8a28e0be598aa0617eda06669b7b0f1d8/data/helpers.d/php#L284-L287
ynh_remove_fpm_config 2> >(grep -v 'WARNING E: Unable to locate package')
#=================================================
# GENERIC FINALIZATION

View file

@ -97,7 +97,8 @@ then
# Set permissions on app files
ynh_system_user_create --username=$app
ynh_add_nginx_config
ynh_add_fpm_config --package="$extra_php_dependencies"
ynh_install_app_dependencies "$extra_php_dependencies"
ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
ynh_script_progression --message="restore data..." --weight=10
@ -144,7 +145,8 @@ then
# Set permissions on app files
ynh_system_user_create --username=$app
ynh_add_nginx_config
ynh_add_fpm_config --package="$extra_php_dependencies"
ynh_install_app_dependencies "$extra_php_dependencies"
ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
ynh_script_progression --message="restore data..." --weight=10
@ -213,7 +215,8 @@ ynh_add_nginx_config
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies"
ynh_install_app_dependencies "$extra_php_dependencies"
ynh_add_fpm_config
#=======================================================
# backup bdd, squelettes directory and config.local.php