From 51999c97dabf9fbbe352ca3ead02851a982fcade Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Fri, 16 Sep 2011 17:10:50 +0300 Subject: solver: inheritable solver flags allow per-name solver flags to be inheritable, and use them in self-upgrade, add -u and the fix applet. this gives more familiar behaviour for the upgrades. --- src/fix.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/fix.c') diff --git a/src/fix.c b/src/fix.c index fa3b744..4798ebe 100644 --- a/src/fix.c +++ b/src/fix.c @@ -20,6 +20,7 @@ struct fix_ctx { unsigned short solver_flags; + int fix_depends : 1; }; static int fix_parse(void *pctx, struct apk_db_options *dbopts, @@ -27,6 +28,9 @@ static int fix_parse(void *pctx, struct apk_db_options *dbopts, { struct fix_ctx *ctx = (struct fix_ctx *) pctx; switch (optch) { + case 'd': + ctx->fix_depends = 1; + break; case 'u': ctx->solver_flags |= APK_SOLVERF_UPGRADE; break; @@ -76,7 +80,10 @@ static int fix_main(void *pctx, struct apk_database *db, int argc, char **argv) apk_error("%s is not installed", name->name); goto err; } - apk_solver_set_name_flags(name, ctx->solver_flags); + apk_solver_set_name_flags( + name, + ctx->solver_flags, + ctx->fix_depends ? ctx->solver_flags : 0); } r = apk_solver_commit(db, 0, db->world); @@ -85,6 +92,7 @@ err: } static struct apk_option fix_options[] = { + { 'd', "depends", "Fix all dependencies too" }, { 'u', "upgrade", "Upgrade package if possible" }, { 'r', "reinstall", "Reinstall the package" }, }; -- cgit v1.2.3-60-g2f50