diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2007-08-08 19:31:03 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2007-08-08 19:31:03 +0200 |
commit | 73eb1788912790f19d42d8c95b98fcb5760fbbdf (patch) | |
tree | 9b254387f00a509dfe8b77e28dedd952b7d924fd | |
parent | b799e134fc730519cc8f0c0ea4387badffac4092 (diff) | |
parent | 95f45727964767f11534eb5347af3fc3a8a6e020 (diff) |
* methods/copy.cc:
- take hashes here too
* apt-pkg/acquire-worker.cc:
- only pass on computed hash if we recived one from the method
-rw-r--r-- | apt-pkg/acquire-worker.cc | 4 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | methods/copy.cc | 8 |
3 files changed, 15 insertions, 3 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 460f59961..739c9e32c 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -273,7 +273,9 @@ bool pkgAcquire::Worker::RunMessages() if(!expectedHash.empty()) { string hashTag = expectedHash.HashType()+"-Hash"; - RecivedHash = expectedHash.HashType() + ":" + LookupTag(Message, hashTag.c_str()); + string hashSum = LookupTag(Message, hashTag.c_str()); + if(!hashSum.empty()) + RecivedHash = expectedHash.HashType() + ":" + hashSum; if(_config->FindB("Debug::pkgAcquire::Auth", false) == true) { clog << "201 URI Done: " << Owner->DescURI() << endl diff --git a/debian/changelog b/debian/changelog index c4eba136f..710472d67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,12 @@ apt (0.7.6ubuntu4) gutsy; urgency=low * cmdline/apt-get.cc: - remove YnPrompt when a XS-Vcs- tag is found, improve the notice (LP: #129575) + * methods/copy.cc: + - take hashes here too + * apt-pkg/acquire-worker.cc: + - only pass on computed hash if we recived one from the method - -- + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 08 Aug 2007 19:30:29 +0200 apt (0.7.6ubuntu3) gutsy; urgency=low diff --git a/methods/copy.cc b/methods/copy.cc index d737e3c33..8dd0bd3f5 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -12,6 +12,8 @@ #include <apt-pkg/fileutl.h> #include <apt-pkg/acquire-method.h> #include <apt-pkg/error.h> +#include <apt-pkg/hashes.h> +#include <apt-pkg/fileutl.h> #include <sys/stat.h> #include <utime.h> @@ -78,7 +80,11 @@ bool CopyMethod::Fetch(FetchItem *Itm) To.OpFail(); 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; } |