diff options
author | Timo Teräs <timo.teras@iki.fi> | 2011-09-14 10:38:26 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2011-09-14 10:57:51 +0300 |
commit | f51aa6d42d0dc53ac58c6d5bce23ddc464051f91 (patch) | |
tree | b2cb095ab5f461777449a52dc36911bc83c8eb67 /src/solver.c | |
parent | 1817b0a3c3ebd57e5332a80c15c70c46ec3eb8c0 (diff) | |
download | apk-tools-f51aa6d42d0dc53ac58c6d5bce23ddc464051f91.tar.gz apk-tools-f51aa6d42d0dc53ac58c6d5bce23ddc464051f91.tar.bz2 apk-tools-f51aa6d42d0dc53ac58c6d5bce23ddc464051f91.tar.xz apk-tools-f51aa6d42d0dc53ac58c6d5bce23ddc464051f91.zip |
upgrade: reimplement self-upgrade (after solver merge)
Diffstat (limited to 'src/solver.c')
-rw-r--r-- | src/solver.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/solver.c b/src/solver.c index aa73481..48ba846 100644 --- a/src/solver.c +++ b/src/solver.c @@ -745,6 +745,17 @@ static int free_state(apk_hash_item item, void *ctx) return 0; } +static int free_package(apk_hash_item item, void *ctx) +{ + struct apk_package *pkg = (struct apk_package *) item; + + if (pkg->state_ptr != NULL) { + free(pkg->state_ptr); + pkg->state_ptr = NULL; + } + return 0; +} + void apk_solver_set_name_flags(struct apk_name *name, unsigned short solver_flags) { @@ -816,6 +827,7 @@ int apk_solver_solve(struct apk_database *db, apk_package_array_free(&ss->best_solution); apk_hash_foreach(&db->available.names, free_state, NULL); + apk_hash_foreach(&db->available.packages, free_package, NULL); free(ss); return r; @@ -1066,7 +1078,7 @@ all_done: apk_dependency_array_copy(&db->world, world); apk_db_write_config(db); - if (r == 0) { + if (r == 0 && !db->performing_self_update) { apk_message("OK: %d packages, %d dirs, %d files", db->installed.stats.packages, db->installed.stats.dirs, |