diff options
author | Timo Teräs <timo.teras@iki.fi> | 2023-03-04 13:54:54 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2023-04-11 20:47:43 +0300 |
commit | 67f5a753e50da8737dc28b0ea2c2194b21d76fdd (patch) | |
tree | 657a81a529d2733eecae1837cc48ac25abe73357 /src/app_info.c | |
parent | efb55ce650d3cac9a607560d840f95c1127e68f5 (diff) | |
download | apk-tools-67f5a753e50da8737dc28b0ea2c2194b21d76fdd.tar.gz apk-tools-67f5a753e50da8737dc28b0ea2c2194b21d76fdd.tar.bz2 apk-tools-67f5a753e50da8737dc28b0ea2c2194b21d76fdd.tar.xz apk-tools-67f5a753e50da8737dc28b0ea2c2194b21d76fdd.zip |
db, apps: sort display results based on package names
Diffstat (limited to 'src/app_info.c')
-rw-r--r-- | src/app_info.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/app_info.c b/src/app_info.c index 8454f0f..2cdbad6 100644 --- a/src/app_info.c +++ b/src/app_info.c @@ -350,18 +350,19 @@ static void info_subaction(struct info_ctx *ctx, struct apk_package *pkg) } } -static void print_name_info(struct apk_database *db, const char *match, struct apk_name *name, void *pctx) +static int print_name_info(struct apk_database *db, const char *match, struct apk_name *name, void *pctx) { struct info_ctx *ctx = (struct info_ctx *) pctx; struct apk_provider *p; if (name == NULL) { ctx->errors++; - return; + return 0; } foreach_array_item(p, name->providers) info_subaction(ctx, p->pkg); + return 0; } #define INFO_OPTIONS(OPT) \ @@ -454,9 +455,7 @@ static int info_main(void *ctx, struct apk_database *db, struct apk_string_array ictx->action(ictx, db, args); } else if (args->num > 0) { /* Print info on given names */ - apk_name_foreach_matching( - db, args, APK_FOREACH_NULL_MATCHES_ALL | apk_foreach_genid(), - print_name_info, ctx); + apk_db_foreach_sorted_name(db, args, print_name_info, ctx); } else { /* Print all installed packages */ list_for_each_entry(ipkg, &db->installed.packages, installed_pkgs_list) |