[maemo-commits] [maemo-commits] r9959 - projects/haf/trunk/apt

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Feb 16 16:16:11 EET 2007
Author: marivoll
Date: 2007-02-16 16:16:10 +0200 (Fri, 16 Feb 2007)
New Revision: 9959

Modified:
   projects/haf/trunk/apt/transientsigs.patch
Log:
Updated to apply cleanly.


Modified: projects/haf/trunk/apt/transientsigs.patch
===================================================================
--- projects/haf/trunk/apt/transientsigs.patch	2007-02-16 14:15:36 UTC (rev 9958)
+++ projects/haf/trunk/apt/transientsigs.patch	2007-02-16 14:16:10 UTC (rev 9959)
@@ -1,8 +1,8 @@
 Index: apt-pkg/acquire-item.cc
 ===================================================================
---- apt-pkg/acquire-item.cc	(revision 5175)
+--- apt-pkg/acquire-item.cc	(revision 9895)
 +++ apt-pkg/acquire-item.cc	(working copy)
-@@ -332,23 +332,6 @@
+@@ -755,17 +755,6 @@
     Desc.ShortDesc = ShortDesc;
     Desc.URI = URI;
     
@@ -15,31 +15,24 @@
 -      // File was already in place.  It needs to be re-verified
 -      // because Release might have changed, so Move it into partial
 -      Rename(Final,DestFile);
--      // unlink the file and do not try to use I-M-S and Last-Modified
--      // if the users proxy is broken
--      if(_config->FindB("Acquire::BrokenProxy", false) == true) {
--	 std::cerr << "forcing re-get of the signature file as requested" << std::endl;
--	 unlink(DestFile.c_str());
--      }
 -   }
 -
     QueueURI(Desc);
  }
  									/*}}}*/
-@@ -357,8 +340,10 @@
+@@ -774,8 +763,10 @@
  /* The only header we use is the last-modified header. */
  string pkgAcqMetaSig::Custom600Headers()
  {
--   struct stat Buf;
++   string Final = _config->FindDir("Dir::State::lists");
++   Final += URItoFileName(RealURI);
+    struct stat Buf;
 -   if (stat(DestFile.c_str(),&Buf) != 0)
-+  string Final = _config->FindDir("Dir::State::lists");
-+  Final += URItoFileName(RealURI);
-+  struct stat Buf;
 +   if (stat(Final.c_str(),&Buf) != 0)
        return "\nIndex-File: true";
  
     return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
-@@ -388,6 +373,21 @@
+@@ -805,6 +796,21 @@
  
     Complete = true;
  
@@ -61,20 +54,17 @@
     // queue a pkgAcqMetaIndex to be verified against the sig we just retrieved
     new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
  		       DestFile, IndexTargets, MetaIndexParser);
-@@ -396,31 +396,61 @@
+@@ -813,22 +819,49 @@
  									/*}}}*/
  void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
  {
--   // Delete any existing sigfile, so that this source isn't
--   // mistakenly trusted
--   string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
--   unlink(Final.c_str());
 +   string Final =
 +     _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
  
--   // if we get a timeout if fail
+-   // if we get a network error we fail gracefully
 -   if(LookupTag(Message,"FailReason") == "Timeout" || 
--      LookupTag(Message,"FailReason") == "TmpResolveFailure") {
+-      LookupTag(Message,"FailReason") == "TmpResolveFailure" ||
+-      LookupTag(Message,"FailReason") == "ConnectionRefused") {
 -      Item::Failed(Message,Cnf);
 -      return;
 -   }
@@ -84,11 +74,9 @@
 +   //
 +   if (StringToBool(LookupTag(Message,"Transient-Failure"),false))
 +     {
-+       cerr << "transient " << Final << "\n";
 +       struct stat Buf;
 +       if (stat(Final.c_str(),&Buf) == 0)
 +	 {
-+	   cerr << "have old version\n";
 +	   Rename (Final, DestFile); 
 +	   new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc,
 +			       MetaIndexShortDesc,
@@ -108,53 +96,31 @@
 +       // mistakenly trusted
 +       unlink(Final.c_str());
  
--   // queue a pkgAcqMetaIndex with no sigfile
--   new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
--		       "", IndexTargets, MetaIndexParser);
-+       // if we get a timeout if fail
+-   // Delete any existing sigfile when the acquire failed
+-   string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
+-   unlink(Final.c_str());
++       // if we get a network error we fail gracefully
 +       if(LookupTag(Message,"FailReason") == "Timeout" || 
-+	  LookupTag(Message,"FailReason") == "TmpResolveFailure") {
++	  LookupTag(Message,"FailReason") == "TmpResolveFailure" ||
++	  LookupTag(Message,"FailReason") == "ConnectionRefused") {
 +	 Item::Failed(Message,Cnf);
 +	 return;
 +       }
  
+-   // queue a pkgAcqMetaIndex with no sigfile
+-   new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
+-		       "", IndexTargets, MetaIndexParser);
 +       // queue a pkgAcqMetaIndex with no sigfile
-+       new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc,
-+			   MetaIndexShortDesc,
++       new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
 +			   "", IndexTargets, MetaIndexParser);
 +     }
-+
+ 
     if (Cnf->LocalOnly == true || 
         StringToBool(LookupTag(Message,"Transient-Failure"),false) == false)
--   {      
--      // Ignore this
-+     {      
-+       // Ignore this
-       Status = StatDone;
-       Complete = false;
-       Dequeue();
-       return;
--   }
-+     }
-    
-    Item::Failed(Message,Cnf);
- }
-@@ -690,13 +720,44 @@
- void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
- {
-    if (AuthPass == true)
--   {
--      // gpgv method failed
--      _error->Warning("GPG error: %s: %s",
--                      Desc.Description.c_str(),
--                      LookupTag(Message,"Message").c_str());
--   }
-+     {
-+       // gpgv method failed
-+       _error->Warning("GPG error: %s: %s",
-+		       Desc.Description.c_str(),
-+		       LookupTag(Message,"Message").c_str());
-+     }
+@@ -1157,7 +1190,38 @@
+                       LookupTag(Message,"Message").c_str());
+ 
+    }
 +   else
 +     {
 +       // If this is a transient failure, we use the old version, if we


More information about the maemo-commits mailing list