From c6d2e17c7762c333e08d0e30c3f2ee78365a9618 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sun, 21 Jan 2024 17:51:17 +0100 Subject: [PATCH] Fix PHP/APT dependency confusion when upgrading through many versions --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 280eb7d..582158c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,6 +56,10 @@ exec_occ() { if [[ "$NEXTCLOUD_PHP_VERSION" != "$phpversion" ]]; then local pkg_dependencies="$(dpkg-query --show --showformat='${Depends}' ${app}-ynh-deps)" pkg_dependencies="${pkg_dependencies//$phpversion/$NEXTCLOUD_PHP_VERSION}" + # Packaging v1 ~legacy : ynh_install_app_dependencies is designed to be called several times + # but the second time it will *append* the list of dependencies rather than replace the existing dependencies + # resulting in a crash when parsing what's the php version the app uses, hence we need to force the full-replacement + YNH_INSTALL_APP_DEPENDENCIES_REPLACE=true ynh_install_app_dependencies "$pkg_dependencies" fi (cd "$install_dir" && ynh_exec_as "$app" \