diff options
author | Michael Vogt <mvo@ubuntu.com> | 2014-09-26 18:09:32 +0200 |
---|---|---|
committer | Michael Vogt <mvo@ubuntu.com> | 2014-09-26 18:09:32 +0200 |
commit | 48fd4181ad0261d5f3e8894dcbfccfaea1530645 (patch) | |
tree | 9df89db20deaf1ffcaf4846858c2ad126c08aacc /methods | |
parent | d916e2a93b798e29d342e9498266767c5be8e2a5 (diff) | |
parent | 5f982b9d903b38bb5549479f0111d31e2695090c (diff) |
Merge remote-tracking branch 'donkult/feature/generalize-gzipindex' into debian/sid
Diffstat (limited to 'methods')
-rw-r--r-- | methods/copy.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/methods/copy.cc b/methods/copy.cc index b78053d36..40f8f85ec 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -37,15 +37,12 @@ class CopyMethod : public pkgAcqMethod void CopyMethod::CalculateHashes(FetchResult &Res) { - // For gzip indexes we need to look inside the gzip for the hash - // We can not use the extension here as its not used in partial - // on a IMS hit - FileFd::OpenMode OpenMode = FileFd::ReadOnly; + Hashes Hash; + FileFd::CompressMode CompressMode = FileFd::None; if (_config->FindB("Acquire::GzipIndexes", false) == true) - OpenMode = FileFd::ReadOnlyGzip; + CompressMode = FileFd::Extension; - Hashes Hash; - FileFd Fd(Res.Filename, OpenMode); + FileFd Fd(Res.Filename, FileFd::ReadOnly, CompressMode); Hash.AddFD(Fd); Res.TakeHashes(Hash); } |