X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/d5a46051cbefe237a9b855603f6cbd50e8e407f2..99ba7cc1901c761c97d67775f23858b86594f2ba:/ftparchive/cachedb.cc diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index 17df9c1f1..868029abd 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -434,7 +434,24 @@ static void hex2bytes(uint8_t *bytes, const char *hex, int length) { } bool CacheDB::GetHashes(bool const GenOnly, unsigned int const DoHashes) { - unsigned int FlHashes = DoHashes & (Hashes::MD5SUM | Hashes::SHA1SUM | Hashes::SHA256SUM | Hashes::SHA512SUM); + unsigned int notCachedHashes = 0; + if ((CurStat.Flags & FlMD5) != FlMD5) + { + notCachedHashes = notCachedHashes | Hashes::MD5SUM; + } + if ((CurStat.Flags & FlSHA1) != FlSHA1) + { + notCachedHashes = notCachedHashes | Hashes::SHA1SUM; + } + if ((CurStat.Flags & FlSHA256) != FlSHA256) + { + notCachedHashes = notCachedHashes | Hashes::SHA256SUM; + } + if ((CurStat.Flags & FlSHA512) != FlSHA512) + { + notCachedHashes = notCachedHashes | Hashes::SHA512SUM; + } + unsigned int FlHashes = DoHashes & notCachedHashes; HashesList.clear(); if (FlHashes != 0)