summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-06-24 09:58:47 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-06-24 09:58:47 +0000
commitd36ab88eb8a5e490e4a817b87f20cb3f890e0da1 (patch)
treed4894e6c33fa0a6f9467a5696e907f0a12e3843e
parent80fa0d8a1a77f4dab696dcf11d1908ecda761fab (diff)
* write the state file after a successfull commit from the pkgManager
-rw-r--r--apt-pkg/packagemanager.cc5
-rw-r--r--cmdline/apt-get.cc3
2 files changed, 5 insertions, 3 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index a08ccd602..a97c94fdf 100644
--- a/apt-pkg/packagemanager.cc
+++ b/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;
}
/*}}}*/
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index bc8cd1ae5..f1496c9e2 100644
--- a/cmdline/apt-get.cc
+++ b/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)