]> git.saurik.com Git - apt.git/commitdiff
Fail over
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:52:11 +0000 (16:52 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:52:11 +0000 (16:52 +0000)
Author: jgg
Date: 1998-12-11 06:32:33 GMT
Fail over

apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h
apt-pkg/acquire.cc

index 4edaa964fadae4a74d69d1fa0ed00809dced0688..59301784e04b3ce79f0a56a1c1926bef8a0b42c8 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acquire-item.cc,v 1.16 1998/12/11 06:01:23 jgg Exp $
+// $Id: acquire-item.cc,v 1.17 1998/12/11 06:32:33 jgg Exp $
 /* ######################################################################
 
    Acquire Item - Item to acquire
@@ -54,6 +54,7 @@ pkgAcquire::Item::~Item()
 void pkgAcquire::Item::Failed(string Message)
 {
    Status = StatIdle;
+   ErrorText = LookupTag(Message,"Message");
    if (QueueCounter <= 1)
    {
       /* This indicates that the file is not available right now but might
@@ -66,7 +67,6 @@ void pkgAcquire::Item::Failed(string Message)
         return;
       }
       
-      ErrorText = LookupTag(Message,"Message");
       Status = StatError;
       Owner->Dequeue(this);
    }   
@@ -474,3 +474,13 @@ string pkgAcqArchive::Describe()
    return Desc.URI;
 }
                                                                        /*}}}*/
+// AcqArchive::Failed - Failure handler                                        /*{{{*/
+// ---------------------------------------------------------------------
+/* Here we try other sources */
+void pkgAcqArchive::Failed(string Message)
+{
+   ErrorText = LookupTag(Message,"Message");
+   if (QueueNext() == false)
+      Item::Failed(Message);
+}
+                                                                       /*}}}*/
index 4a2a4e38559148fbe7efe43ae70d3b4b9679ae37..0b80ca1de28d11f8ffd94c5d2e3342ae64979035 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acquire-item.h,v 1.11 1998/12/11 06:01:25 jgg Exp $
+// $Id: acquire-item.h,v 1.12 1998/12/11 06:32:34 jgg Exp $
 /* ######################################################################
 
    Acquire Item - Item to acquire
@@ -120,6 +120,7 @@ class pkgAcqArchive : public pkgAcquire::Item
    
    public:
    
+   virtual void Failed(string Message);
    virtual void Done(string Message,unsigned long Size,string Md5Hash);
    virtual string Describe();
    
index 385e773ffe76f9c4057900b60f5858b1e24ee2c5..e73619530a0732b8a33b214e4133f0ed2023c9ba 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acquire.cc,v 1.21 1998/12/11 06:01:26 jgg Exp $
+// $Id: acquire.cc,v 1.22 1998/12/11 06:32:35 jgg Exp $
 /* ######################################################################
 
    Acquire - File Acquiration
@@ -566,6 +566,9 @@ pkgAcquire::Queue::QItem *pkgAcquire::Queue::FindItem(string URI,pkgAcquire::Wor
 bool pkgAcquire::Queue::ItemDone(QItem *Itm)
 {
    PipeDepth--;
+   if (Itm->Owner->Status == pkgAcquire::Item::StatFetching)
+      Itm->Owner->Status = pkgAcquire::Item::StatDone;
+   
    if (Itm->Owner->QueueCounter <= 1)
       Owner->Dequeue(Itm->Owner);
    else