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

This commit is contained in:
Alexandre Aubin 2022-02-09 17:52:23 +01:00
parent 61a01f5c81
commit 31d3719b48

View file

@ -281,7 +281,9 @@ ynh_remove_fpm_config() {
fi fi
# If the PHP version used is not the default version for YunoHost # 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 # Remove app dependencies ... but ideally should happen via an explicit call from packager
ynh_remove_app_dependencies ynh_remove_app_dependencies
fi fi