summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-09-12 12:48:06 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2017-07-26 19:07:55 +0200
commitee3200962ea9c63a567347299b4f7ef201f90811 (patch)
tree759ee1dcf7efc59849f9756e31f8161064acf75f
parentb1165a67b1f47f64082fce9a4af80838a2f5e55c (diff)
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.
-rw-r--r--apt-pkg/depcache.cc8
1 files changed, 4 insertions, 4 deletions
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());