From 5576e7f76da73f3f5217f90d816cc19b6c0a5a77 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 1 Aug 2023 13:59:09 +0200 Subject: Compare SHA256 to check if versions are really the same If we know both SHA256, and they're different, the packages are. This approach stores the SHA256 only at runtime, avoiding the overhead of storing it on-disk, because when we update repositories we update all of them anyhow. Note that pkgCacheGenerator is hidden, so we can just modify its ABI, hooray. Closes: #931175 LP: #2029268 --- apt-pkg/deb/deblistparser.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apt-pkg/deb/deblistparser.h') diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index eefce2a6a..e6767d7d5 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -14,6 +14,9 @@ #include #include #include +#ifdef APT_COMPILING_APT +#include +#endif #include #include @@ -90,6 +93,13 @@ class APT_HIDDEN debListParser : public pkgCacheListParser explicit debListParser(FileFd *File); virtual ~debListParser(); + +#ifdef APT_COMPILING_APT + APT::StringView SHA256() const + { + return Section.Find(pkgTagSection::Key::SHA256); + } +#endif }; class APT_HIDDEN debDebFileParser : public debListParser -- cgit v1.2.3-70-g09d2