summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin@piware.de <>2010-06-17 13:36:52 +0200
committermartin@piware.de <>2010-06-17 13:36:52 +0200
commit0b9032b180763ec974cdc918f93910540f05293a (patch)
tree2e8b818278ef29934f7696716762cd1eaa78acaf
parent321798bedb529edf914f2c884e4d38363c908315 (diff)
pkgAcqIndex::Done(): If we have an IMS-Hit, also rename the destination file in GzipIndexes mode, to avoid it being cleaned
-rw-r--r--apt-pkg/acquire-item.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index bcfe6a98a..fe81ee791 100644
--- a/apt-pkg/acquire-item.cc
+++ b/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