From 67f5a753e50da8737dc28b0ea2c2194b21d76fdd Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Sat, 4 Mar 2023 13:54:54 +0200 Subject: db, apps: sort display results based on package names --- src/app_fix.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/app_fix.c') diff --git a/src/app_fix.c b/src/app_fix.c index ccd1e3c..5169176 100644 --- a/src/app_fix.c +++ b/src/app_fix.c @@ -74,15 +74,18 @@ static void mark_fix(struct fix_ctx *ctx, struct apk_name *name) apk_solver_set_name_flags(name, ctx->solver_flags, ctx->fix_depends ? ctx->solver_flags : 0); } -static void set_solver_flags(struct apk_database *db, const char *match, struct apk_name *name, void *pctx) +static int set_solver_flags(struct apk_database *db, const char *match, struct apk_name *name, void *pctx) { struct fix_ctx *ctx = pctx; if (!name) { apk_error("Package '%s' not found", match); ctx->errors++; - } else - mark_fix(ctx, name); + return 0; + } + + mark_fix(ctx, name); + return 0; } static int fix_main(void *pctx, struct apk_database *db, struct apk_string_array *args) @@ -103,7 +106,7 @@ static int fix_main(void *pctx, struct apk_database *db, struct apk_string_array mark_fix(ctx, ipkg->pkg->name); } } else - apk_name_foreach_matching(db, args, apk_foreach_genid(), set_solver_flags, ctx); + apk_db_foreach_matching_name(db, args, set_solver_flags, ctx); if (ctx->errors) return ctx->errors; -- cgit v1.2.3-60-g2f50