[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#328485: update also leaves behind files it cannot unzip



On Sat, Oct 29, 2005 at 04:38:10AM -0700, jrodman@328485.spamportal.net wrote:
> I use the round-robin name http.us.debian.org in my apt.sources file.
> For some reason, the Sources.gz file on one or more of the mirrors is
> incorrectly constructed, or possibly I am receiving an error document.
> I have not successfully investigated this aspect yet.
> 
> However, after this occurs, apt will never recover, leaving the invalid
> Sources.gz in partial despite attempts to update again, blocking
> successful acquisition of a valid Sources.gz
[..]

Thanks for your bugreport.

It will eventually recover when it gets a newer If-Modified-Since
value for the file. Still I think there is not a lot value in keeping
a file around in partial that was successfully downloaded but that
can't be uncompressed. Could you please have a look at the attached
patch and check if it solves your problem?

Cheers,
 Michael


-- 
Linux is not The Answer. Yes is the answer. Linux is The Question. - Neo
* looking for michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-84 to compare with
* comparing to michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-84: . done.

* modified files

--- orig/apt-pkg/acquire-item.cc
+++ mod/apt-pkg/acquire-item.cc
@@ -183,8 +183,14 @@
 
 void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 {
+   // if we are in Decompression state and that fails, remove the
+   // file from partial, no need to keep a broken file around
+   if (Decompression == true)
+      unlink(DestFile.c_str());
+
    // no .bz2 found, retry with .gz
-   if(Desc.URI.substr(Desc.URI.size()-3,Desc.URI.size()-1) == "bz2") {
+   if(Desc.URI.substr(Desc.URI.size()-3,Desc.URI.size()-1) == "bz2") 
+   {
       Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz"; 
 
       // retry with a gzip one 




Reply to: