summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-04-17 16:06:50 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-04-17 16:06:50 +0200
commiteaa204a9808eb2392f4a03d703b585ba3aa3b018 (patch)
treeb879a12b3e524310d84a8d41949d5395d802da25 /apt-pkg/acquire-item.cc
parenta8cdfb5aaa972f8df0016381ea7ad1be5c38a3d1 (diff)
parentc03462c6fed27e26b2bab4b3b34589fa8bf464f8 (diff)
* apt-pkg/acquire-item.cc:
- if decompression of a index fails, delete the index (LP#68202) * [internal-ABI] apt-pkg/acquire.{cc,h}: - deal better with duplicated sources.list entries (avoid double queuing of URLs) - this fixes hangs in bzip/gzip (LP#102511)
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-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 3be7878bf..04f0bb943 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -233,6 +233,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";
@@ -244,9 +245,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);
}