summaryrefslogtreecommitdiff
path: root/src/app_info.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2023-03-06 22:00:45 +0200
committerTimo Teräs <timo.teras@iki.fi>2023-04-11 20:55:13 +0300
commit8feb2cae4da3ad7aad9b8dea5f19c20c296bc786 (patch)
tree05e7dd39c70fb9311713824d09894232d85deed3 /src/app_info.c
parent84e0e00805aca0530a8891975a8a04390df8945c (diff)
downloadapk-tools-8feb2cae4da3ad7aad9b8dea5f19c20c296bc786.tar.gz
apk-tools-8feb2cae4da3ad7aad9b8dea5f19c20c296bc786.tar.bz2
apk-tools-8feb2cae4da3ad7aad9b8dea5f19c20c296bc786.tar.xz
apk-tools-8feb2cae4da3ad7aad9b8dea5f19c20c296bc786.zip
db, info: sort installed package based data by package name
Diffstat (limited to 'src/app_info.c')
-rw-r--r--src/app_info.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/app_info.c b/src/app_info.c
index 1187dae..cf7f58f 100644
--- a/src/app_info.c
+++ b/src/app_info.c
@@ -444,7 +444,6 @@ static int option_parse_applet(void *pctx, struct apk_db_options *dbopts, int op
static int info_main(void *ctx, struct apk_database *db, struct apk_string_array *args)
{
struct info_ctx *ictx = (struct info_ctx *) ctx;
- struct apk_installed_package *ipkg;
ictx->db = db;
if (ictx->subaction_mask == 0)
@@ -456,8 +455,10 @@ static int info_main(void *ctx, struct apk_database *db, struct apk_string_array
apk_db_foreach_sorted_providers(db, args, print_name_info, ctx);
} else {
/* Print all installed packages */
- list_for_each_entry(ipkg, &db->installed.packages, installed_pkgs_list)
- verbose_print_pkg(ipkg->pkg, 1);
+ struct apk_package_array *pkgs = apk_db_sorted_installed_packages(db);
+ struct apk_package **ppkg;
+ foreach_array_item(ppkg, pkgs)
+ verbose_print_pkg(*ppkg, 1);
}
return ictx->errors;