summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authormartin@piware.de <>2010-06-11 10:43:43 +0200
committermartin@piware.de <>2010-06-11 10:43:43 +0200
commitbb109d0b14218cde4fccc45856cf67e5513c0cc9 (patch)
tree549ef07dceb78f3507216b76025a9c6347921917 /apt-pkg/acquire-item.cc
parentfdd739c74dcf266a7cb2f3688ea11afec4055f2c (diff)
Fix compressed index retrieval for current timestamps
Fix a thinko in r1973, which did the Acquire::GzipIndexes test ealier than the IMS-Hit test. This led to rename errors.
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc33
1 files changed, 16 insertions, 17 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index eab34e26c..83fb5328b 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -716,23 +716,6 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash,
Erase = false;
Complete = true;
- string compExt = flExtension(flNotDir(URI(Desc.URI).Path));
-
- // If we enable compressed indexes and already have gzip, keep it
- if (_config->FindB("Acquire::GzipIndexes",false) && compExt == "gz") {
- string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(RealURI) + ".gz";
- //if(Debug)
- // std::clog << "pkgAcqIndex: keeping gzipped " << FinalFile << endl;
- Rename(DestFile,FinalFile);
- chmod(FinalFile.c_str(),0644);
-
- // Update DestFile for .gz suffix so that the clean operation keeps it
- DestFile = _config->FindDir("Dir::State::lists") + "partial/";
- DestFile += URItoFileName(RealURI) + ".gz";
- return;
- }
-
// Handle the unzipd case
string FileName = LookupTag(Message,"Alt-Filename");
if (FileName.empty() == false)
@@ -765,8 +748,24 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash,
else
Local = true;
+ string compExt = flExtension(flNotDir(URI(Desc.URI).Path));
string decompProg;
+ // If we enable compressed indexes and already have gzip, keep it
+ if (_config->FindB("Acquire::GzipIndexes",false) && compExt == "gz") {
+ string FinalFile = _config->FindDir("Dir::State::lists");
+ FinalFile += URItoFileName(RealURI) + ".gz";
+ //if(Debug)
+ // std::clog << "pkgAcqIndex: keeping gzipped " << FinalFile << endl;
+ Rename(DestFile,FinalFile);
+ chmod(FinalFile.c_str(),0644);
+
+ // Update DestFile for .gz suffix so that the clean operation keeps it
+ DestFile = _config->FindDir("Dir::State::lists") + "partial/";
+ DestFile += URItoFileName(RealURI) + ".gz";
+ return;
+ }
+
// get the binary name for your used compression type
decompProg = _config->Find(string("Acquire::CompressionTypes::").append(compExt),"");
if(decompProg.empty() == false);