]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/acquire-item.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 15 Mar 2013 13:55:43 +0000 (14:55 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 15 Mar 2013 13:55:43 +0000 (14:55 +0100)
  - keep the last good InRelease file around just as we do it with
    Release.gpg in case the new one we download isn't good for us

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

index a30e98858adf645763408442fc185ade9a1413e7..39b842dfb88af62b417718dc08c4b3b04714ff69 100644 (file)
@@ -1503,20 +1503,17 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
    if (AuthPass == true)
    {
       // gpgv method failed, if we have a good signature 
-      string LastGoodSigFile = _config->FindDir("Dir::State::lists");
-      if (DestFile == SigFile)
-        LastGoodSigFile.append(URItoFileName(RealURI));
-      else
-        LastGoodSigFile.append("partial/").append(URItoFileName(RealURI)).append(".gpg.reverify");
+      string LastGoodSigFile = _config->FindDir("Dir::State::lists").append("partial/").append(URItoFileName(RealURI));
+      if (DestFile != SigFile)
+        LastGoodSigFile.append(".gpg");
+      LastGoodSigFile.append(".reverify");
 
       if(FileExists(LastGoodSigFile))
       {
+        string VerifiedSigFile = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
         if (DestFile != SigFile)
-        {
-           string VerifiedSigFile = _config->FindDir("Dir::State::lists") +
-                                       URItoFileName(RealURI) + ".gpg";
-           Rename(LastGoodSigFile,VerifiedSigFile);
-        }
+           VerifiedSigFile.append(".gpg");
+        Rename(LastGoodSigFile, VerifiedSigFile);
         Status = StatTransientNetworkError;
         _error->Warning(_("A error occurred during the signature "
                           "verification. The repository is not updated "
@@ -1577,6 +1574,15 @@ pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire *Owner,                /*{{{*/
        MetaSigURI(MetaSigURI), MetaSigURIDesc(MetaSigURIDesc), MetaSigShortDesc(MetaSigShortDesc)
 {
    SigFile = DestFile;
+
+   // keep the old InRelease around in case of transistent network errors
+   string const Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
+   struct stat Buf;
+   if (stat(Final.c_str(),&Buf) == 0)
+   {
+      string const LastGoodSig = DestFile + ".reverify";
+      Rename(Final,LastGoodSig);
+   }
 }
                                                                        /*}}}*/
 // pkgAcqMetaClearSig::Custom600Headers - Insert custom request headers        /*{{{*/
index 0423cefa66017a4c1d52952eceae0f2dac04a8df..77e8674a0a1cbea1a7a8153887eb147785b5af36 100644 (file)
@@ -7,6 +7,9 @@ apt (0.9.7.9) UNRELEASED; urgency=low
     - ExecGPGV is a method which should never return, so mark it as such
       and fix the inconsistency of returning in error cases
     - don't close stdout/stderr if it is also the statusfd
+  * apt-pkg/acquire-item.cc:
+    - keep the last good InRelease file around just as we do it with
+      Release.gpg in case the new one we download isn't good for us
 
  -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 15 Mar 2013 14:15:43 +0100