From 6b7f299dc68221c1baac43911b85e4b397defdbf Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 26 May 2020 18:12:07 +0200 Subject: [PATCH] Revert "Ugly hack to workaround sury pinning issues when installing dependencies" This reverts commit fc30d82df5a6aaae305489021c26b225530b398b. --- data/helpers.d/apt | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/data/helpers.d/apt b/data/helpers.d/apt index c6621d814..e64a54058 100644 --- a/data/helpers.d/apt +++ b/data/helpers.d/apt @@ -193,37 +193,17 @@ ynh_package_install_from_equivs () { LC_ALL=C equivs-build ./control 1> /dev/null dpkg --force-depends --install "./${pkgname}_${pkgversion}_all.deb" 2>&1) - # Let's try to see if install will work using dry-run. It it fails, - # it could be because the pinning of sury is blocking some package install - # c.f. for example: https://github.com/YunoHost/issues/issues/1563#issuecomment-623406509 - # ... In that case, we use an ugly hack were we'll use a tweaked - # preferences.d directory with looser contrains for sury... - if ! ynh_package_install --fix-broken --dry-run >/dev/null 2>&1 && [ -e /etc/apt/preferences.d/extra_php_version ] - then - cp -r /etc/apt/preferences.d/ /etc/apt/preferences.d.tmp/ - sed 's/^Pin-Priority: .*/Pin-Priority: 600/g' -i /etc/apt/preferences.d.tmp/extra_php_version - local apt_tweaks='--option Dir::Etc::preferencesparts=preferences.d.tmp' - # Try a dry-run again to see if that fixes the issue ... - # If it did not, then that's probably not related to sury. - ynh_package_install $apt_tweaks --fix-broken --dry-run >/dev/null 2>&1 || apt_tweaks="" - else - local apt_tweaks="" - fi - - # Try to install for real - ynh_package_install $apt_tweaks --fix-broken || \ + ynh_package_install --fix-broken || \ { # If the installation failed # (the following is ran inside { } to not start a subshell otherwise ynh_die wouldnt exit the original process) - rm --recursive --force /etc/apt/preferences.d.tmp/ # Get the list of dependencies from the deb local dependencies="$(dpkg --info "$TMPDIR/${pkgname}_${pkgversion}_all.deb" | grep Depends | \ sed 's/^ Depends: //' | sed 's/,//g')" # Fake an install of those dependencies to see the errors # The sed command here is, Print only from '--fix-broken' to the end. - ynh_package_install $apt_tweaks $dependencies --dry-run | sed --quiet '/--fix-broken/,$p' >&2 + ynh_package_install $dependencies --dry-run | sed --quiet '/--fix-broken/,$p' >&2 ynh_die --message="Unable to install dependencies"; } [[ -n "$TMPDIR" ]] && rm --recursive --force $TMPDIR # Remove the temp dir. - rm --recursive --force /etc/apt/preferences.d.tmp/ # check if the package is actually installed ynh_package_is_installed "$pkgname"