diff options
-rw-r--r-- | apt-private/private-cmndline.cc | 1 | ||||
-rw-r--r-- | apt-private/private-show.cc | 18 | ||||
-rwxr-xr-x | test/integration/test-apt-cli-show | 14 |
3 files changed, 25 insertions, 8 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 9af241947..5cb282c9e 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -349,6 +349,7 @@ static bool addArgumentsAPT(std::vector<CommandLine::Args> &Args, char const * c else if (CmdMatches("show") || CmdMatches("info")) { addArg('a', "all-versions", "APT::Cache::AllVersions", 0); + addArg('f', "full", "APT::Cache::ShowFull", 0); } else if (addArgumentsAPTGet(Args, Cmd) || addArgumentsAPTCache(Args, Cmd)) { diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc index 07b5a3ae3..b56b87d67 100644 --- a/apt-private/private-show.cc +++ b/apt-private/private-show.cc @@ -253,17 +253,19 @@ static bool DisplayRecordV2(pkgCacheFile &CacheFile, pkgRecords &Recs, /*{{{*/ manual_installed = !(state.Flags & pkgCache::Flag::Auto) ? "yes" : "no"; } - // FIXME: add verbose that does not do the removal of the tags? std::vector<pkgTagSection::Tag> RW; // delete, apt-cache show has this info and most users do not care - RW.push_back(pkgTagSection::Tag::Remove("MD5sum")); - RW.push_back(pkgTagSection::Tag::Remove("SHA1")); - RW.push_back(pkgTagSection::Tag::Remove("SHA256")); - RW.push_back(pkgTagSection::Tag::Remove("SHA512")); - RW.push_back(pkgTagSection::Tag::Remove("Filename")); - RW.push_back(pkgTagSection::Tag::Remove("Multi-Arch")); + if (not _config->FindB("APT::Cache::ShowFull", false)) + { + RW.push_back(pkgTagSection::Tag::Remove("MD5sum")); + RW.push_back(pkgTagSection::Tag::Remove("SHA1")); + RW.push_back(pkgTagSection::Tag::Remove("SHA256")); + RW.push_back(pkgTagSection::Tag::Remove("SHA512")); + RW.push_back(pkgTagSection::Tag::Remove("Filename")); + RW.push_back(pkgTagSection::Tag::Remove("Multi-Arch")); + RW.push_back(pkgTagSection::Tag::Remove("Conffiles")); + } RW.push_back(pkgTagSection::Tag::Remove("Architecture")); - RW.push_back(pkgTagSection::Tag::Remove("Conffiles")); // we use the translated description RW.push_back(pkgTagSection::Tag::Remove("Description")); RW.push_back(pkgTagSection::Tag::Remove("Description-md5")); diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show index 72f079c1e..05a801f6a 100755 --- a/test/integration/test-apt-cli-show +++ b/test/integration/test-apt-cli-show @@ -42,6 +42,20 @@ APT-Sources: file:$APTARCHIVE unstable/main all Packages Description: Some description That has multiple lines " apt show foo +testsuccessequal "Package: foo +Version: 1.0 +Priority: optional +Section: other +Maintainer: Joe Sixpack <joe@example.org> +Installed-Size: 43.0 kB +Filename: pool/main/foo/foo_1.0_all.deb +SHA256: 0000000000000000000000000000000000000000000000000000000000000000 +Download-Size: 42 B +APT-Manual-Installed: yes +APT-Sources: file:$APTARCHIVE unstable/main all Packages +Description: Some description + That has multiple lines +" apt show foo --full testsuccessequal "Package: bar Version: 1 Priority: optional |