diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2007-08-06 10:45:59 -0300 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2007-08-06 10:45:59 -0300 |
commit | ded14999815cc2dea0fe1916ceacc307ea339d40 (patch) | |
tree | bc949fe3866d5f02ac54488037fd94048eb32319 | |
parent | cfc65c4a385e28bd4ce49278fb926e6d7933fc28 (diff) |
* Add hash support to copy method. Thanks Anders Kaseorg by the patch
(closes: #436055)
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | methods/copy.cc | 5 |
2 files changed, 11 insertions, 1 deletions
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 <michael.vogt@ubuntu.com> 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 <otavio@debian.org> 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 <apt-pkg/fileutl.h> #include <apt-pkg/acquire-method.h> #include <apt-pkg/error.h> +#include <apt-pkg/hashes.h> #include <sys/stat.h> #include <utime.h> @@ -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; } |