summaryrefslogtreecommitdiff
path: root/apt-private/private-update.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-06-18 08:32:47 +0200
committerMichael Vogt <mvo@debian.org>2014-06-18 08:32:47 +0200
commitaa0bd601ea3db281187275bbbece760d85ff29d9 (patch)
treec84bebb3966255cdae36562024592c6b4eb6a2f2 /apt-private/private-update.cc
parent80624be7c54aec6ed98ee254366155024fca1a71 (diff)
parent6074bc9ba4ecdd08674a828bdb46323b5d8bf957 (diff)
Merge branch 'debian/sid' into debian/experimental
Conflicts: debian/changelog
Diffstat (limited to 'apt-private/private-update.cc')
-rw-r--r--apt-private/private-update.cc18
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;
}
/*}}}*/