From 31d3719b480324c475cdd3886256e2026249450c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 9 Feb 2022 17:52:23 +0100 Subject: [PATCH] php helpers: only trigger the legacy remove_apt_deps inside ynh_remove_fpm_config if we're in the remove string to prevent epic catastrophies when the app changes php version --- data/helpers.d/php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/helpers.d/php b/data/helpers.d/php index d6ccc52cd..8bc9fb8f3 100644 --- a/data/helpers.d/php +++ b/data/helpers.d/php @@ -281,7 +281,9 @@ ynh_remove_fpm_config() { fi # If the PHP version used is not the default version for YunoHost - if [ "$phpversion" != "$YNH_DEFAULT_PHP_VERSION" ]; then + # The second part with YNH_APP_PURGE is an ugly hack to guess that we're inside the remove script + # (we don't actually care about its value, we just check its not empty hence it exists) + if [ "$phpversion" != "$YNH_DEFAULT_PHP_VERSION" ] && [ -n "${YNH_APP_PURGE:-}" ]; then # Remove app dependencies ... but ideally should happen via an explicit call from packager ynh_remove_app_dependencies fi