Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
support compressed extended_states file for bug triage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DonKult committed Jul 26, 2017
1 parent b1165a6 commit ee32009
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apt-pkg/depcache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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());

Expand Down

0 comments on commit ee32009

Please sign in to comment.