diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2023-08-01 13:59:09 +0200 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2023-08-02 12:04:32 +0200 |
| commit | 5576e7f76da73f3f5217f90d816cc19b6c0a5a77 (patch) | |
| tree | b5caa7891f49ae697bd1b8fb0db18f2d8a1a1831 /apt-pkg/deb | |
| parent | 2a8830218bef1fa5fb01a387bddf7d76087eea58 (diff) | |
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
Diffstat (limited to 'apt-pkg/deb')
| -rw-r--r-- | apt-pkg/deb/deblistparser.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 <apt-pkg/pkgcache.h> #include <apt-pkg/pkgcachegen.h> #include <apt-pkg/tagfile.h> +#ifdef APT_COMPILING_APT +#include <apt-pkg/tagfile-keys.h> +#endif #include <string> #include <vector> @@ -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 |
