summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-04-17 15:31:29 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-04-17 15:31:29 +0200
commit17ff0930e92423954b8fb4377755de7c66f097cd (patch)
treef8659a853c68e1d07afd7af1932c4259ad31ca77 /apt-pkg
parent9fda8ed498f56d8e158134818301b1ef11334c1c (diff)
* apt-pkg/acquire-item.cc:
- if decompression of a index fails, delete the index
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 8ec4ba2c0..f566b16b8 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);
}