From 17ff0930e92423954b8fb4377755de7c66f097cd Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 17 Apr 2007 15:31:29 +0200 Subject: [PATCH] * apt-pkg/acquire-item.cc: - if decompression of a index fails, delete the index --- apt-pkg/acquire-item.cc | 9 ++++++++- debian/changelog | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 8ec4ba2c..f566b16b 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -183,6 +183,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"; @@ -194,9 +195,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); } diff --git a/debian/changelog b/debian/changelog index 9f34fd79..1786bdfb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -apt (0.6.46.5) UNRELEASED; urgency=low +apt (0.6.47) UNRELEASED; urgency=low * apt-pkg/algorithm.cc: - use clog for all debugging @@ -16,6 +16,8 @@ apt (0.6.46.5) UNRELEASED; urgency=low - only umount if it was mounted by the method before * po/gl.po: - fix error translation that causes trouble to lsb_release + * apt-pkg/acquire-item.cc: + - if decompression of a index fails, delete the index -- Michael Vogt Mon, 18 Dec 2006 19:39:05 +0100 -- 2.20.1