Browse Source

* apt-pkg/acquire-item.cc:
- Use Release files even if they cannot be verified (LP: #704595)

Julian Andres Klode 15 years ago
parent
commit
7ea7ac9efa
2 changed files with 22 additions and 0 deletions
  1. 20 0
      apt-pkg/acquire-item.cc
  2. 2 0
      debian/changelog

+ 20 - 0
apt-pkg/acquire-item.cc

@@ -1502,6 +1502,26 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
       ReportMirrorFailure("GPGFailure");
       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
    // No Release file was present, or verification failed, so fall
    // back to queueing Packages files without verification
    // back to queueing Packages files without verification
    QueueIndexes(false);
    QueueIndexes(false);

+ 2 - 0
debian/changelog

@@ -3,6 +3,8 @@ apt (0.8.13.3) UNRELEASED; urgency=low
   * apt-pkg/indexcopy.cc:
   * apt-pkg/indexcopy.cc:
     - Use RealFileExists() instead of FileExists(), allows amongst other
     - Use RealFileExists() instead of FileExists(), allows amongst other
       things a directory named Sources to exist on a CD-ROM (LP: #750694).
       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
  -- Julian Andres Klode <jak@debian.org>  Thu, 07 Apr 2011 11:48:46 +0200