summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2022-01-21 15:33:30 +0000
committerJulian Andres Klode <jak@debian.org>2022-01-21 15:33:30 +0000
commit56b4c513df0b8ddaf8a17530ea58125017eb899f (patch)
treefb0dc4d5128c612fba2111b9efbd23ab4af58ca4
parenta25a4d3372ca621c4a98e369578e2769029e17be (diff)
parent78981cd5ec19563cf3bca2495c56e31124ae069a (diff)
Merge branch 'pu/show-full' into 'main'
Add a --full mode to apt show See merge request apt-team/apt!212
-rw-r--r--apt-private/private-cmndline.cc1
-rw-r--r--apt-private/private-show.cc18
-rwxr-xr-xtest/integration/test-apt-cli-show14
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