summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2006-12-14 12:39:29 +0100
committerMichael Vogt <egon@bottom>2006-12-14 12:39:29 +0100
commit6ca714d55119e87a01bd475abd08e7212dcafbd0 (patch)
tree264c3a939b34f5daea19f45619686f060569f34d /apt-pkg/acquire-item.cc
parent0660506d1916f6538359f238e860804441ba24f3 (diff)
parentdc4002d8c3c687e6614d01b34e4b6aa929411ea9 (diff)
* merged the apt-breaks-iwj branch
* pulled in the other remaining ubuntu changes
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index bcffa77f5..020047c06 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -78,7 +78,7 @@ void pkgAcquire::Item::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
Dequeue();
return;
}
-
+
Status = StatError;
Dequeue();
}
@@ -773,8 +773,9 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,
DestFile = _config->FindDir("Dir::State::lists") + "partial/";
DestFile += URItoFileName(URI);
- // remove any partial downloaded sig-file. it may confuse proxies
- // and is too small to warrant a partial download anyway
+ // remove any partial downloaded sig-file in partial/.
+ // it may confuse proxies and is too small to warrant a
+ // partial download anyway
unlink(DestFile.c_str());
// Create the item
@@ -841,17 +842,22 @@ void pkgAcqMetaSig::Done(string Message,unsigned long Size,string MD5,
/*}}}*/
void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
{
+ string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
// if we get a network error we fail gracefully
- if(LookupTag(Message,"FailReason") == "Timeout" ||
- LookupTag(Message,"FailReason") == "TmpResolveFailure" ||
- LookupTag(Message,"FailReason") == "ConnectionRefused") {
+ if(Status == StatTransientNetworkError)
+ {
Item::Failed(Message,Cnf);
+ // move the sigfile back on network failures (and re-authenticated?)
+ if(FileExists(DestFile))
+ Rename(DestFile,Final);
+
+ // set the status back to , Item::Failed likes to reset it
+ Status = pkgAcquire::Item::StatTransientNetworkError;
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