diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-07-13 03:36:59 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-08-10 17:27:18 +0200 |
commit | 9112f77703c39d46e2e0471c48c8a5e1f93f4abf (patch) | |
tree | 63d990155a5e3e3f77daeabcc36529394e08fc9b /apt-private/private-download.cc | |
parent | 6cfadda161ce19e6c8076d0aa118f8f436805a6a (diff) |
show or-groups in not-installed recommends and suggests lists
Further abstracting our new ShowList allows to use it for containers of
strings as well giving us the option to implement an or-groups display
for the recommends and suggests lists which is a nice trick given that
it also helps with migrating the last remaining other cases of old
ShowList.
Diffstat (limited to 'apt-private/private-download.cc')
-rw-r--r-- | apt-private/private-download.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc index 37fae18e9..099146187 100644 --- a/apt-private/private-download.cc +++ b/apt-private/private-download.cc @@ -78,20 +78,23 @@ bool CheckDropPrivsMustBeDisabled(pkgAcquire &Fetcher) /*{{{*/ // CheckAuth - check if each download comes form a trusted source /*{{{*/ bool CheckAuth(pkgAcquire& Fetcher, bool const PromptUser) { - std::string UntrustedList; + std::vector<std::string> UntrustedList; for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I) if (!(*I)->IsTrusted()) - UntrustedList += std::string((*I)->ShortDesc()) + " "; + UntrustedList.push_back((*I)->ShortDesc()); - if (UntrustedList == "") + if (UntrustedList.empty()) return true; return AuthPrompt(UntrustedList, PromptUser); } -bool AuthPrompt(std::string const &UntrustedList, bool const PromptUser) +bool AuthPrompt(std::vector<std::string> const &UntrustedList, bool const PromptUser) { - ShowList(c2out,_("WARNING: The following packages cannot be authenticated!"),UntrustedList,""); + ShowList(c2out,_("WARNING: The following packages cannot be authenticated!"), UntrustedList, + [](std::string const&) { return true; }, + [](std::string const&str) { return str; }, + [](std::string const&) { return ""; }); if (_config->FindB("APT::Get::AllowUnauthenticated",false) == true) { |