From: Michael Vogt Date: Wed, 8 Aug 2007 17:31:03 +0000 (+0200) Subject: * methods/copy.cc: X-Git-Tag: 0.7.24ubuntu1~153 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/73eb1788912790f19d42d8c95b98fcb5760fbbdf?hp=b799e134fc730519cc8f0c0ea4387badffac4092 * methods/copy.cc: - take hashes here too * apt-pkg/acquire-worker.cc: - only pass on computed hash if we recived one from the method --- 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 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 #include #include +#include +#include #include #include @@ -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; }