diff options
author | Michael Vogt <mvo@debian.org> | 2014-06-10 14:49:58 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-06-10 14:49:58 +0200 |
commit | 59d6e5b06c25acdd6583ea801740c36acabc19ac (patch) | |
tree | 9601b003fd15db600922aa60c786523669ffba9c /apt-private | |
parent | ac00cca724734db58ad14ab8c77d445d0df3bc9f (diff) | |
parent | 8f418981337503ff7abedd872f788b51bcdbc886 (diff) |
Merge remote-tracking branch 'mvo/feature/apt-update-info' into debian/sid
Diffstat (limited to 'apt-private')
-rw-r--r-- | apt-private/private-update.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apt-private/private-update.cc b/apt-private/private-update.cc index da83d7741..fa827dea4 100644 --- a/apt-private/private-update.cc +++ b/apt-private/private-update.cc @@ -75,6 +75,24 @@ bool DoUpdate(CommandLine &CmdL) return false; } + // show basic stats (if the user whishes) + if (_config->FindB("APT::Cmd::Show-Update-Stats", false) == true) + { + int upgradable = 0; + Cache.Open(); + for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() != true; ++I) + { + pkgDepCache::StateCache &state = Cache[I]; + if (I->CurrentVer != 0 && state.Upgradable()) + upgradable++; + } + const char *msg = ngettext( + "%i package can be upgraded. Run 'apt list --upgradable' to see it.\n", + "%i packages can be upgraded. Run 'apt list --upgradable' to see them.\n", + upgradable); + ioprintf(c1out, msg, upgradable); + } + return true; } /*}}}*/ |