summaryrefslogtreecommitdiff
path: root/methods/copy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'methods/copy.cc')
-rw-r--r--methods/copy.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/methods/copy.cc b/methods/copy.cc
index f3cd84215..a8e289df5 100644
--- a/methods/copy.cc
+++ b/methods/copy.cc
@@ -28,16 +28,16 @@
class CopyMethod : public pkgAcqMethod
{
virtual bool Fetch(FetchItem *Itm);
- void CalculateHashes(FetchResult &Res);
+ void CalculateHashes(FetchItem const * const Itm, FetchResult &Res);
public:
CopyMethod() : pkgAcqMethod("1.0",SingleInstance | SendConfig) {};
};
-void CopyMethod::CalculateHashes(FetchResult &Res)
+void CopyMethod::CalculateHashes(FetchItem const * const Itm, FetchResult &Res)
{
- Hashes Hash;
+ Hashes Hash(Itm->ExpectedHashes);
FileFd::CompressMode CompressMode = FileFd::None;
if (_config->FindB("Acquire::GzipIndexes", false) == true)
CompressMode = FileFd::Extension;
@@ -71,7 +71,7 @@ bool CopyMethod::Fetch(FetchItem *Itm)
// just calc the hashes if the source and destination are identical
if (File == Itm->DestFile)
{
- CalculateHashes(Res);
+ CalculateHashes(Itm, Res);
URIDone(Res);
return true;
}
@@ -104,7 +104,7 @@ bool CopyMethod::Fetch(FetchItem *Itm)
if (utimes(Res.Filename.c_str(), times) != 0)
return _error->Errno("utimes",_("Failed to set modification time"));
- CalculateHashes(Res);
+ CalculateHashes(Itm, Res);
URIDone(Res);
return true;