DestFile += URItoFileName(URI);
// Create the item
- Desc.URI = URI + ".gz";
+ Desc.URI = URI + ".bz2";
Desc.Description = URIDesc;
Desc.Owner = this;
Desc.ShortDesc = ShortDesc;
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
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;
}
/*}}}*/
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();
-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