]> git.saurik.com Git - apt.git/commitdiff
cherry pick 2162.1.2 from the debian-sid branch
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 16 Sep 2011 07:37:02 +0000 (09:37 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 16 Sep 2011 07:37:02 +0000 (09:37 +0200)
apt-pkg/acquire-item.cc
debian/changelog

index c31d5d2b3de390a51025f02c4240d911bf68886c..d14342c02ce96ad5ec41b00bc5da18ff15f1d887 100644 (file)
@@ -1258,9 +1258,9 @@ void pkgAcqMetaIndex::Done(string Message,unsigned long long Size,string Hash,    /
       if (SigFile == "")
       {
          // There was no signature file, so we are finished.  Download
       if (SigFile == "")
       {
          // There was no signature file, so we are finished.  Download
-         // the indexes and do only hashsum verification
+         // the indexes and do only hashsum verification if possible
          MetaIndexParser->Load(DestFile);
          MetaIndexParser->Load(DestFile);
-         QueueIndexes(true);
+         QueueIndexes(false);
       }
       else
       {
       }
       else
       {
@@ -1378,33 +1378,30 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify)                         /*{{{*/
         ++Target)
    {
       HashString ExpectedIndexHash;
         ++Target)
    {
       HashString ExpectedIndexHash;
-      if (verify)
+      const indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey);
+      if (Record == NULL)
       {
       {
-        const indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey);
-        if (Record == NULL)
+        if (verify == true && (*Target)->IsOptional() == false)
         {
         {
-           if ((*Target)->IsOptional() == false)
-           {
-              Status = StatAuthError;
-              strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str());
-              return;
-           }
+           Status = StatAuthError;
+           strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str());
+           return;
         }
         }
-        else
+      }
+      else
+      {
+        ExpectedIndexHash = Record->Hash;
+        if (_config->FindB("Debug::pkgAcquire::Auth", false))
         {
         {
-           ExpectedIndexHash = Record->Hash;
-           if (_config->FindB("Debug::pkgAcquire::Auth", false))
-           {
-              std::cerr << "Queueing: " << (*Target)->URI << std::endl;
-              std::cerr << "Expected Hash: " << ExpectedIndexHash.toStr() << std::endl;
-              std::cerr << "For: " << Record->MetaKeyFilename << std::endl;
-           }
-           if (ExpectedIndexHash.empty() == true && (*Target)->IsOptional() == false)
-           {
-              Status = StatAuthError;
-              strprintf(ErrorText, _("Unable to find hash sum for '%s' in Release file"), (*Target)->MetaKey.c_str());
-              return;
-           }
+           std::cerr << "Queueing: " << (*Target)->URI << std::endl;
+           std::cerr << "Expected Hash: " << ExpectedIndexHash.toStr() << std::endl;
+           std::cerr << "For: " << Record->MetaKeyFilename << std::endl;
+        }
+        if (verify == true && ExpectedIndexHash.empty() == true && (*Target)->IsOptional() == false)
+        {
+           Status = StatAuthError;
+           strprintf(ErrorText, _("Unable to find hash sum for '%s' in Release file"), (*Target)->MetaKey.c_str());
+           return;
         }
       }
 
         }
       }
 
index 3b7685f2a23533902555e8facab393459536d962..17f7795288a6d5426ca56024a3f7e1dc50ee622b 100644 (file)
@@ -4,6 +4,11 @@ apt (0.8.16~exp5ubuntu9) UNRELEASEDoneiric; urgency=low
   * apt-pkg/acquire-item.h, apt-pkg/deb/debmetaindex.cc:
     - fix fetching language information by adding OptionalSubIndexTarget
 
   * apt-pkg/acquire-item.h, apt-pkg/deb/debmetaindex.cc:
     - fix fetching language information by adding OptionalSubIndexTarget
 
+  [ David Kalnischkies ]
+  * apt-pkg/acquire-item.cc:
+    - if no Release.gpg file is found try to verify with hashes,
+      but do not fail if a hash can't be found
+
  -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 16 Sep 2011 09:16:32 +0200
 
 apt (0.8.16~exp5ubuntu8) oneiric; urgency=low
  -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 16 Sep 2011 09:16:32 +0200
 
 apt (0.8.16~exp5ubuntu8) oneiric; urgency=low