From ffe5a25fdb0dd178ba36b9f72c5213565adf19f0 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 13 Apr 2024 22:37:38 +0200 Subject: apt: Default to N in the y/N prompt if there were warnings This especially helps with the running out of space warnings to be safe. --- apt-private/private-install.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index b53aea167..ecbd703d8 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -441,8 +441,9 @@ bool InstallPackages(CacheFile &Cache, APT::PackageVector &HeldBackPackages, boo if (_config->FindI("quiet",0) < 2 && _config->FindB("APT::Get::Assume-Yes",false) == false) { - // YnPrompt shows all warnings before prompting, so ask stronger if we have any - if (YnPrompt(outVer < 30 ? _("Do you want to continue?") : (_error->empty() ? _("Continue?") : _("Continue anyway?"))) == false) + // YnPrompt shows all warnings before prompting, so ask stronger and default to N if we have any. + auto Default = outVer < 30 ? true : _error->empty(); + if (not YnPrompt(outVer < 30 ? _("Do you want to continue?") : (Default ? _("Continue?") : _("Continue anyway?")), Default)) { c2out << _("Abort.") << std::endl; exit(1); -- cgit v1.2.3-18-g5258