diff options
author | Julian Andres Klode <jak@debian.org> | 2024-04-13 22:37:38 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2024-04-13 22:37:38 +0200 |
commit | ffe5a25fdb0dd178ba36b9f72c5213565adf19f0 (patch) | |
tree | e259515e01b2d8364a8d52ba776ae0487a3ead66 | |
parent | 0ea8b5a34118d57e8aad7229360a5acafa1d1c1e (diff) |
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.
-rw-r--r-- | apt-private/private-install.cc | 5 |
1 files 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); |