* apt-pkg/acquire-item.cc:
authorJulian Andres Klode <jak@debian.org>
Fri, 8 Apr 2011 11:57:04 +0000 (13:57 +0200)
committerJulian Andres Klode <jak@debian.org>
Fri, 8 Apr 2011 11:57:04 +0000 (13:57 +0200)
  - Use Release files even if they cannot be verified (LP: #704595)

apt-pkg/acquire-item.cc
debian/changelog

index 39b9fef..1d651ba 100644 (file)
@@ -1502,6 +1502,26 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
       ReportMirrorFailure("GPGFailure");
    }
 
+   /* Always move the meta index, even if gpgv failed. This ensures
+    * that PackageFile objects are correctly filled in */
+   {
+      string FinalFile = _config->FindDir("Dir::State::lists");
+      FinalFile += URItoFileName(RealURI);
+      /* InRelease files become Release files, otherwise
+       * they would be considered as trusted later on */
+      if (SigFile == DestFile) {
+        RealURI = RealURI.replace(RealURI.rfind("InRelease"), 9,
+                                      "Release");
+        FinalFile = FinalFile.replace(FinalFile.rfind("InRelease"), 9,
+                                      "Release");
+        SigFile = FinalFile;
+      }
+      Rename(DestFile,FinalFile);
+      chmod(FinalFile.c_str(),0644);
+
+      DestFile = FinalFile;
+   }
+
    // No Release file was present, or verification failed, so fall
    // back to queueing Packages files without verification
    QueueIndexes(false);
index 34e34c3..486a4de 100644 (file)
@@ -3,6 +3,8 @@ apt (0.8.13.3) UNRELEASED; urgency=low
   * apt-pkg/indexcopy.cc:
     - Use RealFileExists() instead of FileExists(), allows amongst other
       things a directory named Sources to exist on a CD-ROM (LP: #750694).
+  * apt-pkg/acquire-item.cc:
+    - Use Release files even if they cannot be verified (LP: #704595)
 
  -- Julian Andres Klode <jak@debian.org>  Thu, 07 Apr 2011 11:48:46 +0200