diff options
author | Michael Vogt <mvo@debian.org> | 2014-01-23 07:52:23 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-01-23 07:57:52 +0100 |
commit | 06293aa79b46efdec96910b2f678ce1cbdecc86d (patch) | |
tree | e7c15d5ba62d6e4805373cd57613b456ddbec8b7 /apt-private/private-show.cc | |
parent | 9e51c0b6a3a1a36336820eda11bcfd5534d9d80c (diff) |
Show only the candidate with "apt show"
Display only the candidate version with "apt show pkg" but show
a notice that there is more to see.
Diffstat (limited to 'apt-private/private-show.cc')
-rw-r--r-- | apt-private/private-show.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc index 32a49cc5c..9a8386167 100644 --- a/apt-private/private-show.cc +++ b/apt-private/private-show.cc @@ -104,12 +104,20 @@ bool ShowPackage(CommandLine &CmdL) /*{{{*/ { pkgCacheFile CacheFile; CacheSetHelperVirtuals helper(true, GlobalError::NOTICE); - APT::VersionList::Version const select = APT::VersionList::CANDIDATE; + APT::VersionList::Version const select = _config->FindB("APT::Cache::AllVersions", false) ? + APT::VersionList::ALL : APT::VersionList::CANDIDATE; APT::VersionList const verset = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, select, helper); for (APT::VersionList::const_iterator Ver = verset.begin(); Ver != verset.end(); ++Ver) if (DisplayRecord(CacheFile, Ver, c1out) == false) return false; + if (select == APT::VersionList::CANDIDATE) + { + APT::VersionList const verset_all = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, APT::VersionList::ALL, helper); + if (verset_all.size() > verset.size()) + _error->Notice(ngettext("There is %lu additional record. Please use the '-a' switch to see it", "There are %lu additional records. Please use the '-a' switch to see them.", verset_all.size() - verset.size()), verset_all.size() - verset.size()); + } + for (APT::PackageSet::const_iterator Pkg = helper.virtualPkgs.begin(); Pkg != helper.virtualPkgs.end(); ++Pkg) { |