Просмотр исходного кода

pkgAcqIndex::Done(): If we have an IMS-Hit, also rename the destination file in GzipIndexes mode, to avoid it being cleaned

martin@piware.de лет назад: 16
Родитель
Сommit
0b9032b180
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      apt-pkg/acquire-item.cc

+ 7 - 2
apt-pkg/acquire-item.cc

@@ -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