]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-worker.cc
tests: try to support spaces in TMPDIR
[apt.git] / apt-pkg / acquire-worker.cc
index 176772dde47d5c93a75bc0449390cbf7f56cd201..45ee6dde3eecdf4fb35ecab2c3352e64ff0f8080 100644 (file)
@@ -254,8 +254,8 @@ bool pkgAcquire::Worker::RunMessages()
            ItemDone();
 
            // Change the status so that it can be dequeued
            ItemDone();
 
            // Change the status so that it can be dequeued
-           for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O)
-              (*O)->Status = pkgAcquire::Item::StatIdle;
+           for (auto const &O: Itm->Owners)
+              O->Status = pkgAcquire::Item::StatIdle;
            // Mark the item as done (taking care of all queues)
            // and then put it in the main queue again
            std::vector<Item*> const ItmOwners = Itm->Owners;
            // Mark the item as done (taking care of all queues)
            // and then put it in the main queue again
            std::vector<Item*> const ItmOwners = Itm->Owners;
@@ -407,7 +407,13 @@ bool pkgAcquire::Worker::RunMessages()
               else if (Owner->HashesRequired() == true)
                  consideredOkay = false;
               else
               else if (Owner->HashesRequired() == true)
                  consideredOkay = false;
               else
+              {
                  consideredOkay = true;
                  consideredOkay = true;
+                 // even if the hashes aren't usable to declare something secure
+                 // we can at least use them to declare it an integrity failure
+                 if (ExpectedHashes.empty() == false && ReceivedHashes != ExpectedHashes && _config->Find("Acquire::ForceHash").empty())
+                    consideredOkay = false;
+              }
 
               if (consideredOkay == true)
                  consideredOkay = Owner->VerifyDone(Message, Config);
 
               if (consideredOkay == true)
                  consideredOkay = Owner->VerifyDone(Message, Config);