summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire-item.cc32
-rw-r--r--apt-pkg/acquire-item.h1
-rw-r--r--debian/changelog6
3 files changed, 33 insertions, 6 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 27e98283f..bf19290c6 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -144,7 +144,7 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
DestFile += URItoFileName(URI);
// Create the item
- Desc.URI = URI + ".gz";
+ Desc.URI = URI + ".bz2";
Desc.Description = URIDesc;
Desc.Owner = this;
Desc.ShortDesc = ShortDesc;
@@ -167,6 +167,21 @@ string pkgAcqIndex::Custom600Headers()
return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
}
/*}}}*/
+
+void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
+{
+ // no .bz2 found, retry with .gz
+ if(Desc.URI.substr(Desc.URI.size()-3,Desc.URI.size()-1) == "bz2") {
+ Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz";
+ QueueURI(Desc);
+ return;
+ }
+
+
+ Item::Failed(Message,Cnf);
+}
+
+
// AcqIndex::Done - Finished a fetch /*{{{*/
// ---------------------------------------------------------------------
/* This goes through a number of states.. On the initial fetch the
@@ -234,11 +249,22 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string MD5,
else
Local = true;
+ string compExt = Desc.URI.substr(Desc.URI.size()-3,Desc.URI.size()-1);
+ char *decompProg;
+ if(compExt == "bz2")
+ decompProg = "bzip2";
+ else if(compExt == ".gz")
+ decompProg = "gzip";
+ else {
+ _error->Error("Unsupported extension: %s", compExt.c_str());
+ return;
+ }
+
Decompression = true;
DestFile += ".decomp";
- Desc.URI = "gzip:" + FileName;
+ Desc.URI = string(decompProg) + ":" + FileName;
QueueURI(Desc);
- Mode = "gzip";
+ Mode = decompProg;
}
/*}}}*/
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index 62162743d..9dab78f36 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -90,6 +90,7 @@ class pkgAcqIndex : public pkgAcquire::Item
public:
// Specialized action members
+ virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(string Message,unsigned long Size,string Md5Hash,
pkgAcquire::MethodConfig *Cnf);
virtual string Custom600Headers();
diff --git a/debian/changelog b/debian/changelog
index 1ef08105f..c9ea30342 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,7 @@
-apt (0.5.30) unstable; urgency=low
-
- *
+apt (0.5.30) hoary; urgency=low
+ * Patch from Michael Vogt to enable Packages.bz2 use, with a fallback to
+ Packages.gz if it is not present (Closes: #37525)
-- Matt Zimmerman <mdz@debian.org> Mon, 15 Nov 2004 12:57:28 -0800