From 05fae6fae95d8ef6690f3d56863e3bb6a44d424c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 1 Apr 2022 11:37:26 +0200 Subject: Parse Checksum fields via pkgTagSection::Key, too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We abstract hashes a fair bit to be able to add new ones eventually, which lead us to building the field names on the fly. We can do better through by keeping a central place for these names, too, which even helps in reducing code as we don't need the MD5 → Files dance anymore. --- apt-private/private-show.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'apt-private') diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc index 46c4c35e7..08a4fe6df 100644 --- a/apt-private/private-show.cc +++ b/apt-private/private-show.cc @@ -260,10 +260,8 @@ static bool DisplayRecordV2(pkgCacheFile &CacheFile, pkgRecords &Recs, /*{{{*/ // delete, apt-cache show has this info and most users do not care 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")); + for (char const * const * type = HashString::SupportedHashes(); *type != nullptr; ++type) + RW.push_back(pkgTagSection::Tag::Remove(*type)); RW.push_back(pkgTagSection::Tag::Remove("Filename")); RW.push_back(pkgTagSection::Tag::Remove("Multi-Arch")); RW.push_back(pkgTagSection::Tag::Remove("Conffiles")); -- cgit v1.2.3-70-g09d2