summaryrefslogtreecommitdiff
path: root/src/app_info.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2023-03-04 13:54:54 +0200
committerTimo Teräs <timo.teras@iki.fi>2023-03-06 21:39:48 +0200
commit65b46f7462e1acad19884da67a9a59996a642847 (patch)
tree1997054daa45211d97bc273f0a50ccdfe2084ff5 /src/app_info.c
parent5f84463a34bd8c63a3ff649ae550c68934adaa5b (diff)
downloadapk-tools-65b46f7462e1acad19884da67a9a59996a642847.tar.gz
apk-tools-65b46f7462e1acad19884da67a9a59996a642847.tar.bz2
apk-tools-65b46f7462e1acad19884da67a9a59996a642847.tar.xz
apk-tools-65b46f7462e1acad19884da67a9a59996a642847.zip
db, apps: sort display results based on package names
Diffstat (limited to 'src/app_info.c')
-rw-r--r--src/app_info.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/app_info.c b/src/app_info.c
index 509798d..0336300 100644
--- a/src/app_info.c
+++ b/src/app_info.c
@@ -346,18 +346,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) \
@@ -453,9 +454,7 @@ static int info_main(void *ctx, struct apk_ctx *ac, struct apk_string_array *arg
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)