From ded14999815cc2dea0fe1916ceacc307ea339d40 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Mon, 6 Aug 2007 10:45:59 -0300 Subject: [PATCH] * Add hash support to copy method. Thanks Anders Kaseorg by the patch (closes: #436055) --- debian/changelog | 7 ++++++- methods/copy.cc | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3e17696a8..aadf8601c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ apt (0.7.7) UNRELEASED; urgency=low + [ Michael Vogt ] * apt-inst/contrib/extracttar.cc: - fix fd leak for zero size files (thanks to Bill Broadley for reporting this bug) @@ -20,7 +21,11 @@ apt (0.7.7) UNRELEASED; urgency=low [ Program translations ] - French updated - -- Michael Vogt Thu, 02 Aug 2007 11:55:54 +0200 + [ Otavio Salvador ] + * Add hash support to copy method. Thanks Anders Kaseorg by the patch + (closes: #436055) + + -- Otavio Salvador Mon, 06 Aug 2007 10:44:53 -0300 apt (0.7.6) unstable; urgency=low 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; } -- 2.45.2