summaryrefslogtreecommitdiff
path: root/src/upgrade.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-11 14:06:06 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-13 18:22:00 +0300
commitb8c44536ca911418fee1c9ab4eecbb913a1ca852 (patch)
treea89e68b12f4d3daf089c475beeb71c53ffb8cc3a /src/upgrade.c
parentf292a858677ae0e1af8910ffbd4b338f4b36c18b (diff)
downloadapk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.gz
apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.bz2
apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.xz
apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.zip
solver: rewrite as deductive solver -- core features
Implementing basic dependency handling, install_if and awareness of pinning.
Diffstat (limited to 'src/upgrade.c')
-rw-r--r--src/upgrade.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/upgrade.c b/src/upgrade.c
index 3b30fe3..1768795 100644
--- a/src/upgrade.c
+++ b/src/upgrade.c
@@ -45,23 +45,22 @@ int apk_do_self_upgrade(struct apk_database *db, unsigned short solver_flags)
{
struct apk_name *name;
struct apk_changeset changeset = {};
- struct apk_solution_array *solution = NULL;
int r;
name = apk_db_get_name(db, APK_BLOB_STR("apk-tools"));
apk_solver_set_name_flags(name, solver_flags, solver_flags);
db->performing_self_update = 1;
- r = apk_solver_solve(db, 0, db->world, &solution, &changeset);
+ r = apk_solver_solve(db, 0, db->world, &changeset);
if (r != 0) {
if ((r > 0) && (apk_flags & APK_FORCE))
r = 0;
else
- apk_solver_print_errors(db, solution, db->world, r);
+ apk_solver_print_errors(db, &changeset, db->world);
goto ret;
}
- if (changeset.changes->num == 0)
+ if (changeset.num_install + changeset.num_remove + changeset.num_adjust == 0)
goto ret;
if (apk_flags & APK_SIMULATE) {
@@ -83,7 +82,6 @@ int apk_do_self_upgrade(struct apk_database *db, unsigned short solver_flags)
exit(1);
ret:
- apk_solution_array_free(&solution);
apk_change_array_free(&changeset.changes);
db->performing_self_update = 0;