diff options
author | Timo Teräs <timo.teras@iki.fi> | 2011-11-01 08:40:50 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2011-11-01 08:40:50 +0200 |
commit | 078e8b00d8cad783476e3bc507cb0df21b8c20a0 (patch) | |
tree | e890e22203834a877cc951716febaf8f38f74e22 | |
parent | f13ec9cf5efe6de4545b27a56e4806194eae90e2 (diff) | |
download | apk-tools-078e8b00d8cad783476e3bc507cb0df21b8c20a0.tar.gz apk-tools-078e8b00d8cad783476e3bc507cb0df21b8c20a0.tar.bz2 apk-tools-078e8b00d8cad783476e3bc507cb0df21b8c20a0.tar.xz apk-tools-078e8b00d8cad783476e3bc507cb0df21b8c20a0.zip |
solver: return changeset even for partial solutions
otherwise --force does might not work during boot.
-rw-r--r-- | src/solver.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/solver.c b/src/solver.c index ab2ad6f..ff3c495 100644 --- a/src/solver.c +++ b/src/solver.c @@ -991,22 +991,18 @@ int apk_solver_solve(struct apk_database *db, } while (r == 0); /* collect packages */ - if (ss->best_score.unsatisfiable == 0) { - if (changeset != NULL) - generate_changeset(db, ss->best_solution, changeset, - ss->solver_flags); - r = 0; - } else { + if (changeset != NULL) { + generate_changeset(db, ss->best_solution, changeset, + ss->solver_flags); + } + if (solution != NULL) { qsort(ss->best_solution->item, ss->best_solution->num, sizeof(struct apk_package *), compare_package_name); - r = ss->best_score.unsatisfiable; - } - - if (solution != NULL) *solution = ss->best_solution; - else + } else { apk_package_array_free(&ss->best_solution); - + } + r = ss->best_score.unsatisfiable; apk_solver_free(db); free(ss); |