From ded14999815cc2dea0fe1916ceacc307ea339d40 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Mon, 6 Aug 2007 10:45:59 -0300 Subject: * Add hash support to copy method. Thanks Anders Kaseorg by the patch (closes: #436055) --- methods/copy.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'methods/copy.cc') diff --git a/methods/copy.cc b/methods/copy.cc index d737e3c33..72896b4c0 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -79,6 +80,10 @@ bool CopyMethod::Fetch(FetchItem *Itm) return _error->Errno("utime",_("Failed to set modification time")); } + Hashes Hash; + FileFd Fd(Res.Filename, FileFd::ReadOnly); + Hash.AddFD(Fd.Fd(), Fd.Size()); + Res.TakeHashes(Hash); URIDone(Res); return true; } -- cgit v1.2.3