]> git.saurik.com Git - apt.git/commitdiff
* methods/copy.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Wed, 8 Aug 2007 17:31:03 +0000 (19:31 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Wed, 8 Aug 2007 17:31:03 +0000 (19:31 +0200)
  - take hashes here too
* apt-pkg/acquire-worker.cc:
  - only pass on computed hash if we recived one from the method

apt-pkg/acquire-worker.cc
debian/changelog
methods/copy.cc

index 460f599611dba48868c515b7535ad6584fe95365..739c9e32ccacf1e4381e1872b3a3db61c3f3067a 100644 (file)
@@ -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
index c4eba136feb656b7b7275f8e36b90b150901d701..710472d67e4fe7998cf9882d57ba8a6bb6ddf26e 100644 (file)
@@ -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
 
index d737e3c33cb851b646d726c24f00fad053098cce..8dd0bd3f5037334005f29709d19d50feec618348 100644 (file)
@@ -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;
 }