]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/depcache.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 4 Jul 2006 07:22:49 +0000 (09:22 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 4 Jul 2006 07:22:49 +0000 (09:22 +0200)
  - create a empty state file if none exists

apt-pkg/depcache.cc

index 7663d38814b16de97ad0a2fa62deb34edd6cee24..25a4372bf86917362f70c6c70e36dccdbdfb28d0 100644 (file)
@@ -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());