]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-item.cc
pkgAcqIndex::Done(): If we have an IMS-Hit, also rename the destination file in GzipI...
[apt.git] / apt-pkg / acquire-item.cc
index bcfe6a98a164f8946e1a1d21486c1ae8c309651f..fe81ee791263ca9759a6df1c5d4ef2b385a35847 100644 (file)
@@ -739,16 +739,21 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash,
       ErrorText = "Method gave a blank filename";
    }
    
+   string compExt = flExtension(flNotDir(URI(Desc.URI).Path));
+
    // The files timestamp matches
-   if (StringToBool(LookupTag(Message,"IMS-Hit"),false) == true)
+   if (StringToBool(LookupTag(Message,"IMS-Hit"),false) == true) {
+       if (_config->FindB("Acquire::GzipIndexes",false) && compExt == "gz")
+         // Update DestFile for .gz suffix so that the clean operation keeps it
+         DestFile += ".gz";
       return;
+    }
 
    if (FileName == DestFile)
       Erase = true;
    else
       Local = true;
    
-   string compExt = flExtension(flNotDir(URI(Desc.URI).Path));
    string decompProg;
 
    // If we enable compressed indexes and already have gzip, keep it