diff options
author | Michael Vogt <mvo@debian.org> | 2014-09-21 10:18:03 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-09-21 10:18:03 +0200 |
commit | b0f4b486e6850c5f98520ccf19da71d0ed748ae4 (patch) | |
tree | b762d4679dd4705da68d107290bc01622d7de038 /methods | |
parent | 2bd6be8ad24583ed9935f5c5d57c04ba7344111e (diff) | |
download | apt-b0f4b486e6850c5f98520ccf19da71d0ed748ae4.tar.gz |
generalize Acquire::GzipIndex
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); } |