summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc25
1 files changed, 17 insertions, 8 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index b2f896627..dea68f3ee 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -142,20 +142,21 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
{
Decompression = false;
Erase = false;
-
+
DestFile = _config->FindDir("Dir::State::lists") + "partial/";
DestFile += URItoFileName(URI);
if(comprExt.empty())
{
- // autoselect
- if(FileExists("/usr/bin/bzip2"))
- Desc.URI = URI + ".bz2";
- else
- Desc.URI = URI + ".gz";
+ // autoselect the compression method
+ if(FileExists("/usr/bin/bzip2"))
+ CompressionExtension = ".bz2";
+ else
+ CompressionExtension = ".gz";
} else {
- Desc.URI = URI + comprExt;
+ CompressionExtension = comprExt;
}
+ Desc.URI = URI + CompressionExtension;
Desc.Description = URIDesc;
Desc.Owner = this;
@@ -400,6 +401,13 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
unlink(Final.c_str());
+ // if we get a timeout if fail
+ if(LookupTag(Message,"FailReason") == "Timeout" ||
+ LookupTag(Message,"FailReason") == "TmpResolveFailure") {
+ Item::Failed(Message,Cnf);
+ return;
+ }
+
// queue a pkgAcqMetaIndex with no sigfile
new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
"", IndexTargets, MetaIndexParser);
@@ -898,7 +906,8 @@ void pkgAcqArchive::Done(string Message,unsigned long Size,string Md5Hash,
{
Status = StatError;
ErrorText = _("MD5Sum mismatch");
- Rename(DestFile,DestFile + ".FAILED");
+ if(FileExists(DestFile))
+ Rename(DestFile,DestFile + ".FAILED");
return;
}
}