summaryrefslogtreecommitdiff
path: root/src/app_policy.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2023-03-05 12:15:56 +0200
committerTimo Teräs <timo.teras@iki.fi>2023-04-11 20:47:43 +0300
commit58fa82642e1a155e92a218a58753974587b3b956 (patch)
treea83a3428e7fa9bf4a073baa51c85e0edf94f9d5a /src/app_policy.c
parent18b8d1e8ad877eb1eaad5216b821c0fb8394c76b (diff)
downloadapk-tools-58fa82642e1a155e92a218a58753974587b3b956.tar.gz
apk-tools-58fa82642e1a155e92a218a58753974587b3b956.tar.bz2
apk-tools-58fa82642e1a155e92a218a58753974587b3b956.tar.xz
apk-tools-58fa82642e1a155e92a218a58753974587b3b956.zip
db, apps: sort packages by pkgname and pkgver
This will also fix "search" to display one match from each principal pkgname group. "search -e vim" will now show both vim and gvim. fixes #10864 fixes #10777
Diffstat (limited to 'src/app_policy.c')
-rw-r--r--src/app_policy.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/app_policy.c b/src/app_policy.c
index 519257a..8803008 100644
--- a/src/app_policy.c
+++ b/src/app_policy.c
@@ -37,13 +37,12 @@ zlib1g policy:
1.1:
http://nl.alpinelinux.org/alpine/v2.4/main
*/
+ apk_name_sorted_providers(name);
foreach_array_item(p, name->providers) {
- if (p->pkg->name != name)
- continue;
- if (num++ == 0)
- printf("%s policy:\n", name->name);
+ if (p->pkg->name != name) continue;
+ if (num++ == 0) printf("%s policy:\n", name->name);
printf(" " BLOB_FMT ":\n", BLOB_PRINTF(*p->version));
- if (p->pkg->ipkg != NULL)
+ if (p->pkg->ipkg)
printf(" %s\n", apk_installed_file);
for (i = 0; i < db->num_repos; i++) {
repo = &db->repos[i];