Просмотр исходного кода

* write the state file after a successfull commit from the pkgManager

Michael Vogt лет назад: 21
Родитель
Сommit
d36ab88eb8
2 измененных файлов с 5 добавлено и 3 удалено
  1. 5 0
      apt-pkg/packagemanager.cc
  2. 0 3
      cmdline/apt-get.cc

+ 5 - 0
apt-pkg/packagemanager.cc

@@ -637,6 +637,11 @@ pkgPackageManager::OrderResult pkgPackageManager::DoInstall()
    if (Res != Failed)
       if (Go() == false)
 	 return Failed;
+
+   // if all was fine update the state file
+   if(Res == Completed)
+      Cache.writeStateFile(NULL);
+
    return Res;
 }
 									/*}}}*/

+ 0 - 3
cmdline/apt-get.cc

@@ -994,9 +994,6 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
 	 return _error->Error(_("Aborting install."));
       }
 
-      // -- we do it here because there is no libapt::Commit() :/
-      Cache->writeStateFile(NULL);
-       	 
       _system->UnLock();
       pkgPackageManager::OrderResult Res = PM->DoInstall();
       if (Res == pkgPackageManager::Failed || _error->PendingError() == true)