diff options
author | Michael Vogt <mvo@ubuntu.com> | 2014-10-08 10:47:09 +0200 |
---|---|---|
committer | Michael Vogt <mvo@ubuntu.com> | 2014-10-08 10:47:09 +0200 |
commit | 2e8e5aaca4e51737e5a3a56c140d6817251bf0f7 (patch) | |
tree | 1b1224e9b55d4e7f0002feeba51711912d8fb314 /methods/copy.cc | |
parent | d667daf3e6ba5bfc7feb8a5ed0a0bd2d1febde4d (diff) | |
parent | 536fdb8823fdec24c26d984317b8162237c427c3 (diff) |
Merge branch 'debian/sid' into ubuntu/master
Conflicts:
configure.ac
debian/changelog
Diffstat (limited to 'methods/copy.cc')
-rw-r--r-- | methods/copy.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/methods/copy.cc b/methods/copy.cc index 5570f31c8..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); } @@ -55,8 +52,8 @@ void CopyMethod::CalculateHashes(FetchResult &Res) /* */ bool CopyMethod::Fetch(FetchItem *Itm) { - URI Get = Itm->Uri; - std::string File = Get.Path; + // this ensures that relative paths work in copy + std::string File = Itm->Uri.substr(Itm->Uri.find(':')+1); // Stat the file and send a start message struct stat Buf; |