diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-07-04 09:44:51 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-07-04 09:44:51 +0200 |
commit | a381270a2ec3d8a1d83a780db42ded01a80f59a2 (patch) | |
tree | 761d851b4b91ebcbc1051d2736d4c66fda7cd008 /apt-pkg/depcache.cc | |
parent | e9afbeb9df95b582aac76bb44b5ae2b766ab8fd5 (diff) | |
parent | 9a9665f96e006602950e0e32ce80cb5ee14f5e5f (diff) |
* apt-pkg/depcache.cc:
- if no /var/lib/apt/extended_states exists, create a empty one
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r-- | apt-pkg/depcache.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 7663d3881..25a4372bf 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -186,6 +186,15 @@ bool pkgDepCache::writeStateFile(OpProgress *prog) FileFd StateFile; string state = _config->FindDir("Dir::State") + "extended_states"; + + // if it does not exist, create a empty one + if(!FileExists(state)) + { + StateFile.Open(state, FileFd::WriteEmpty); + StateFile.Close(); + } + + // open it if(!StateFile.Open(state, FileFd::ReadOnly)) return _error->Error(_("Failed to open StateFile %s"), state.c_str()); |