1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

Merge pull request #652 from YunoHost-Apps/fix-php-apt-dependency-confusion-during-upgrade

Fix PHP/APT dependency confusion when upgrading through many versions
This commit is contained in:
Alexandre Aubin 2024-01-24 18:58:12 +01:00 committed by GitHub
commit 53aa80eb8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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" \