]> git.saurik.com Git - apt.git/commitdiff
* only remove the sigfile if pkgAcqMetaSig::Failed() didn't fail for a network error
authorMichael Vogt <michael.vogt@ubuntu.com>
Mon, 20 Feb 2006 20:38:11 +0000 (20:38 +0000)
committerMichael Vogt <michael.vogt@ubuntu.com>
Mon, 20 Feb 2006 20:38:11 +0000 (20:38 +0000)
apt-pkg/acquire-item.cc
methods/connect.cc

index 86f61dd00c0fd119cbe5c9c09ba13b3732ae123b..0daca55c9a35fc9e85595469b44ec2ae1dab6876 100644 (file)
@@ -340,12 +340,6 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,
       // File was already in place.  It needs to be re-verified
       // because Release might have changed, so Move it into partial
       Rename(Final,DestFile);
       // 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);
    }
 
    QueueURI(Desc);
@@ -395,18 +389,19 @@ void pkgAcqMetaSig::Done(string Message,unsigned long Size,string MD5,
                                                                        /*}}}*/
 void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 {
                                                                        /*}}}*/
 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());
 
 
-   // if we get a timeout if fail
+   // if we get a network error we fail gracefully
    if(LookupTag(Message,"FailReason") == "Timeout" || 
    if(LookupTag(Message,"FailReason") == "Timeout" || 
-      LookupTag(Message,"FailReason") == "TmpResolveFailure") {
+      LookupTag(Message,"FailReason") == "TmpResolveFailure") ||
+      LookupTag(Message,"FailReason") == "ConnectionRefused") {
       Item::Failed(Message,Cnf);
       return;
    }
 
       Item::Failed(Message,Cnf);
       return;
    }
 
+   // Delete any existing sigfile when the acquire failed
+   string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
+   unlink(Final.c_str());
+
    // 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,
                       "", IndexTargets, MetaIndexParser);
index 4e48927edf65fe3ac7d371875b0de6c031ed994d..8c2ac6d56dab4451b41ba0208297cad60c40fbe1 100644 (file)
@@ -103,6 +103,8 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
    if (Err != 0)
    {
       errno = Err;
    if (Err != 0)
    {
       errno = Err;
+      if(errno == ECONNREFUSED)
+         Owner->SetFailExtraMsg("\nFailReason: ConnectionRefused");
       return _error->Errno("connect",_("Could not connect to %s:%s (%s)."),Host.c_str(),
                           Service,Name);
    }
       return _error->Errno("connect",_("Could not connect to %s:%s (%s)."),Host.c_str(),
                           Service,Name);
    }