From 25353dc6646e5b9fff55059a5c85183589cf472d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 16 Jan 2020 18:19:34 +0100 Subject: pkgcache.cc: Mix PACKAGE_VERSION into the cache hash This ensures that caches build with one version can't be opened with another, which makes sense. It's a temporary approach until we can replace major:minor fields with a version string. For example, this would have prevented 1.9.7 from using broken caches from 1.9.6. --- apt-pkg/pkgcache.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apt-pkg/pkgcache.cc') diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index f8ab423ae..59f4256ea 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -274,6 +274,10 @@ uint32_t pkgCache::CacheHash() header.Dirty = false; header.CacheFileSize = 0; + adler = hash32(adler, + reinterpret_cast(PACKAGE_VERSION), + APT_ARRAY_SIZE(PACKAGE_VERSION)); + adler = hash32(adler, reinterpret_cast(&header), sizeof(header)); -- cgit v1.2.3