X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/ec759a799176881468b85f14c37d3964e199effb..d4a6c3bbb1a57494256ad09c08cc21c9d4f2182a:/apt-pkg/acquire-item.cc diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index c5a5c8e9b..b48972c22 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -605,6 +605,7 @@ string pkgAcqIndex::Custom600Headers() void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) { + // no .bz2 found, retry with .gz if(Desc.URI.substr(Desc.URI.size()-3) == "bz2") { Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz"; @@ -616,9 +617,15 @@ void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) Complete = false; Dequeue(); return; + } + + // on decompression failure, remove bad versions in partial/ + if(Decompression && Erase) { + string s = _config->FindDir("Dir::State::lists") + "partial/"; + s += URItoFileName(RealURI); + unlink(s.c_str()); } - Item::Failed(Message,Cnf); }