helpers/appsv2: don't remove yhh-deps virtual package if ... it doesn't exist. Otherwise when apt fails to install dependency, we end up with another error about failing to remove the ynh-deps package

This commit is contained in:
Alexandre Aubin 2023-03-14 18:45:04 +01:00
parent a95d10e50c
commit 3656c19918

View file

@ -370,7 +370,13 @@ ynh_remove_app_dependencies() {
apt-mark unhold ${dep_app}-ynh-deps apt-mark unhold ${dep_app}-ynh-deps
fi fi
ynh_package_autopurge ${dep_app}-ynh-deps # Remove the fake package and its dependencies if they not still used. # Remove the fake package and its dependencies if they not still used.
# (except if dpkg doesn't know anything about the package,
# which should be symptomatic of a failed install, and we don't want bash to report an error)
if dpkg-query --show ${dep_app}-ynh-deps &>/dev/null
then
ynh_package_autopurge ${dep_app}-ynh-deps
fi
} }
# Install packages from an extra repository properly. # Install packages from an extra repository properly.