From ee3200962ea9c63a567347299b4f7ef201f90811 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 12 Sep 2016 12:48:06 +0200 Subject: support compressed extended_states file for bug triage This file isn't compressed by default, but it might be compressed by a bugreporter and uncompressing it is extra work apt could do just as well on the fly as needed just like it does for the dpkg/status file. --- apt-pkg/depcache.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apt-pkg/depcache.cc') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index efe26dee3..27467441c 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -182,7 +182,7 @@ bool pkgDepCache::readStateFile(OpProgress * const Prog) /*{{{*/ FileFd state_file; string const state = _config->FindFile("Dir::State::extended_states"); if(RealFileExists(state)) { - state_file.Open(state, FileFd::ReadOnly); + state_file.Open(state, FileFd::ReadOnly, FileFd::Extension); off_t const file_size = state_file.Size(); if(Prog != NULL) Prog->OverallProgress(0, file_size, 1, @@ -244,16 +244,16 @@ bool pkgDepCache::writeStateFile(OpProgress * const /*prog*/, bool const Install // if it does not exist, create a empty one if(!RealFileExists(state)) { - StateFile.Open(state, FileFd::WriteAtomic); + StateFile.Open(state, FileFd::WriteAtomic, FileFd::Extension); StateFile.Close(); } // open it - if(!StateFile.Open(state, FileFd::ReadOnly)) + if (!StateFile.Open(state, FileFd::ReadOnly, FileFd::Extension)) return _error->Error(_("Failed to open StateFile %s"), state.c_str()); - FileFd OutFile(state, FileFd::ReadWrite | FileFd::Atomic); + FileFd OutFile(state, FileFd::ReadWrite | FileFd::Atomic, FileFd::Extension); if (OutFile.IsOpen() == false || OutFile.Failed() == true) return _error->Error(_("Failed to write temporary StateFile %s"), state.c_str()); -- cgit v1.2.3