summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:52 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:52 +0000
commit08cfc005c3529d4ff63d229b05d75c6ceb88225b (patch)
tree6a9a7901f7bde71cb427a2bf9064dfbba9e807fa /apt-pkg
parent5ec427c295784f8b50740a7cb2da30b9c86e81e7 (diff)
Retries and tweaked dselect script
Author: jgg Date: 1999-10-17 20:58:36 GMT Retries and tweaked dselect script
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc24
-rw-r--r--apt-pkg/acquire-item.h4
2 files changed, 26 insertions, 2 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 7639dd59a..2bae109fd 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-item.cc,v 1.38 1999/10/17 07:30:23 jgg Exp $
+// $Id: acquire-item.cc,v 1.39 1999/10/17 20:58:36 jgg Exp $
/* ######################################################################
Acquire Item - Item to acquire
@@ -567,6 +567,8 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI,string MD5,
unsigned long Size,string Dsc,string ShortDesc) :
Item(Owner), Md5Hash(MD5)
{
+ Retries = _config->FindI("Acquire::Retries",0);
+
DestFile = flNotDir(URI);
// Create the item
@@ -645,3 +647,23 @@ void pkgAcqFile::Done(string Message,unsigned long Size,string MD5)
}
}
/*}}}*/
+// AcqFile::Failed - Failure handler /*{{{*/
+// ---------------------------------------------------------------------
+/* Here we try other sources */
+void pkgAcqFile::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
+{
+ ErrorText = LookupTag(Message,"Message");
+
+ // This is the retry counter
+ if (Retries != 0 &&
+ Cnf->LocalOnly == false &&
+ StringToBool(LookupTag(Message,"Transient-Failure"),false) == true)
+ {
+ Retries--;
+ QueueURI(Desc);
+ return;
+ }
+
+ Item::Failed(Message,Cnf);
+}
+ /*}}}*/
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index d07a49bb4..fd74280b8 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-item.h,v 1.21 1999/09/01 07:01:15 jgg Exp $
+// $Id: acquire-item.h,v 1.22 1999/10/17 20:58:36 jgg Exp $
/* ######################################################################
Acquire Item - Item to acquire
@@ -151,10 +151,12 @@ class pkgAcqFile : public pkgAcquire::Item
{
pkgAcquire::ItemDesc Desc;
string Md5Hash;
+ unsigned int Retries;
public:
// Specialized action members
+ virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(string Message,unsigned long Size,string Md5Hash);
virtual string MD5Sum() {return Md5Hash;};
virtual string DescURI() {return Desc.URI;};