diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-01-17 14:31:29 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-01-17 14:31:29 +0200 |
commit | eaaba3ee893c7fb3c5a258f0609d8ab6e4637804 (patch) | |
tree | f93b3c96452fcc6a1483e79277a9ca6cd38a4be8 /src/upgrade.c | |
parent | 64b03ab603425560cf752b95350374296729a167 (diff) | |
download | apk-tools-eaaba3ee893c7fb3c5a258f0609d8ab6e4637804.tar.gz apk-tools-eaaba3ee893c7fb3c5a258f0609d8ab6e4637804.tar.bz2 apk-tools-eaaba3ee893c7fb3c5a258f0609d8ab6e4637804.tar.xz apk-tools-eaaba3ee893c7fb3c5a258f0609d8ab6e4637804.zip |
upgrade: make -a reset versioned dependencies like it used to
regression from upgrade to the new solver system.
Diffstat (limited to 'src/upgrade.c')
-rw-r--r-- | src/upgrade.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/upgrade.c b/src/upgrade.c index e8883ad..6ce851b 100644 --- a/src/upgrade.c +++ b/src/upgrade.c @@ -94,7 +94,8 @@ static int upgrade_main(void *ctx, struct apk_database *db, int argc, char **arg { struct upgrade_ctx *uctx = (struct upgrade_ctx *) ctx; unsigned short solver_flags; - int r; + struct apk_dependency_array *world = NULL; + int i, r; solver_flags = APK_SOLVERF_UPGRADE | uctx->solver_flags; if (!uctx->no_self_upgrade) { @@ -103,7 +104,25 @@ static int upgrade_main(void *ctx, struct apk_database *db, int argc, char **arg return r; } - return apk_solver_commit(db, solver_flags, db->world); + if (solver_flags & APK_SOLVERF_AVAILABLE) { + apk_dependency_array_copy(&world, db->world); + for (i = 0; i < world->num; i++) { + struct apk_dependency *dep = &world->item[i]; + if (dep->result_mask == APK_DEPMASK_CHECKSUM) { + dep->result_mask = APK_DEPMASK_REQUIRE; + dep->version = apk_blob_atomize(APK_BLOB_NULL); + } + } + } else { + world = db->world; + } + + r = apk_solver_commit(db, solver_flags, world); + + if (solver_flags & APK_SOLVERF_AVAILABLE) + apk_dependency_array_free(&world); + + return r; } static struct apk_option upgrade_options[] = { |