]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-worker.cc
* dpkg-triggers: Deal properly with new package states.
[apt.git] / apt-pkg / acquire-worker.cc
index 25d40ef542f82a7f8af80c75e6284b6b2c1cf7ff..460f599611dba48868c515b7535ad6584fe95365 100644 (file)
@@ -267,8 +267,23 @@ bool pkgAcquire::Worker::RunMessages()
               _error->Warning("Bizarre Error - File size is not what the server reported %s %lu",
                               LookupTag(Message,"Size","0").c_str(),TotalSize);
 
+           // see if there is a hash to verify
+           string RecivedHash;
+           HashString expectedHash(Owner->HashSum());
+           if(!expectedHash.empty()) 
+           {
+              string hashTag = expectedHash.HashType()+"-Hash";
+              RecivedHash = expectedHash.HashType() + ":" + LookupTag(Message, hashTag.c_str());
+              if(_config->FindB("Debug::pkgAcquire::Auth", false) == true)
+              {
+                 clog << "201 URI Done: " << Owner->DescURI() << endl
+                      << "RecivedHash: " << RecivedHash << endl
+                      << "ExpectedHash: " << expectedHash.toStr() 
+                      << endl << endl;
+              }
+           }
            Owner->Done(Message,atoi(LookupTag(Message,"Size","0").c_str()),
-                       LookupTag(Message,"MD5-Hash"),Config);
+                       RecivedHash.c_str(), Config);
            ItemDone();
            
            // Log that we are done