]> git.saurik.com Git - apt.git/commitdiff
* write the state file after a successfull commit from the pkgManager
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 24 Jun 2005 09:58:47 +0000 (09:58 +0000)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 24 Jun 2005 09:58:47 +0000 (09:58 +0000)
apt-pkg/packagemanager.cc
cmdline/apt-get.cc

index a08ccd6027c293f7bc91cfe761e679c648195db3..a97c94fdf1617df31e5675ef0c34128930cede9a 100644 (file)
@@ -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;
 }
                                                                        /*}}}*/
index bc8cd1ae56605cfc584ab254088425e366c1752e..f1496c9e27b16b0ee9ef6bef06751efef5d3deb0 100644 (file)
@@ -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)