summaryrefslogtreecommitdiff
path: root/src/upgrade.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-09-14 11:30:02 +0300
committerTimo Teräs <timo.teras@iki.fi>2011-09-14 11:30:35 +0300
commite34d2ed5fdec628936711517612a0fe643ed6d33 (patch)
tree2f4dc066ecfd77de2bd641793c6bb6d55c5c8511 /src/upgrade.c
parentf95e7e585087aa6677978205f4ae8ebb9dfd1851 (diff)
downloadapk-tools-e34d2ed5fdec628936711517612a0fe643ed6d33.tar.gz
apk-tools-e34d2ed5fdec628936711517612a0fe643ed6d33.tar.bz2
apk-tools-e34d2ed5fdec628936711517612a0fe643ed6d33.tar.xz
apk-tools-e34d2ed5fdec628936711517612a0fe643ed6d33.zip
solver, db: run triggers in dependency order
fixes #738
Diffstat (limited to 'src/upgrade.c')
-rw-r--r--src/upgrade.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/upgrade.c b/src/upgrade.c
index dd53c19..541fbf3 100644
--- a/src/upgrade.c
+++ b/src/upgrade.c
@@ -52,7 +52,8 @@ int apk_do_self_upgrade(struct apk_database *db, unsigned short solver_flags)
apk_solver_set_name_flags(name, solver_flags);
db->performing_self_update = 1;
- r = apk_solver_solve(db, 0, db->world, &solution, &changeset);
+ r = apk_solver_solve(db, APK_SOLVERF_KEEP_STATE,
+ db->world, &solution, &changeset);
if (r != 0) {
if (apk_flags & APK_FORCE)
r = 0;
@@ -71,6 +72,7 @@ int apk_do_self_upgrade(struct apk_database *db, unsigned short solver_flags)
apk_message("Upgrading critical system libraries and apk-tools:");
apk_solver_commit_changeset(db, &changeset, db->world);
+ apk_solver_free(db);
apk_db_close(db);
apk_message("Continuing the upgrade transaction with new apk-tools:");
@@ -83,6 +85,7 @@ int apk_do_self_upgrade(struct apk_database *db, unsigned short solver_flags)
exit(1);
ret:
+ apk_solver_free(db);
apk_package_array_free(&solution);
apk_change_array_free(&changeset.changes);
db->performing_self_update = 0;