Преглед на файлове

create directory for extended_states if needed

Unlikely perhaps, but there is no guarantee that the directory we want
to drop the file into actually exists, so create it if we must.
David Kalnischkies преди 11 години
родител
ревизия
1b671a9ba2
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      apt-pkg/depcache.cc

+ 3 - 1
apt-pkg/depcache.cc

@@ -237,9 +237,11 @@ bool pkgDepCache::writeStateFile(OpProgress * /*prog*/, bool InstalledOnly)	/*{{
 
    FileFd StateFile;
    string const state = _config->FindFile("Dir::State::extended_states");
+   if (CreateAPTDirectoryIfNeeded(_config->FindDir("Dir::State"), flNotFile(state)) == false)
+      return false;
 
    // if it does not exist, create a empty one
-   if(!RealFileExists(state)) 
+   if(!RealFileExists(state))
    {
       StateFile.Open(state, FileFd::WriteAtomic);
       StateFile.Close();