diff options
author | William Pitcock <nenolod@dereferenced.org> | 2018-01-29 03:17:07 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2018-01-29 03:17:07 +0000 |
commit | d52285c9aa6f9c76e03f1001e7920ddeb6f6203f (patch) | |
tree | 88f26e90ce331203149c5cbe48eb451488feda33 /src/list.c | |
parent | d379edd5bf960de8089b9f2083fc6f14b79e7bba (diff) | |
download | apk-tools-d52285c9aa6f9c76e03f1001e7920ddeb6f6203f.tar.gz apk-tools-d52285c9aa6f9c76e03f1001e7920ddeb6f6203f.tar.bz2 apk-tools-d52285c9aa6f9c76e03f1001e7920ddeb6f6203f.tar.xz apk-tools-d52285c9aa6f9c76e03f1001e7920ddeb6f6203f.zip |
list: use `apk list --providers` to search virtual providers instead of enabling virtuals by default
Diffstat (limited to 'src/list.c')
-rw-r--r-- | src/list.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -26,7 +26,7 @@ struct list_ctx { unsigned int upgradable : 1; unsigned int match_origin : 1; unsigned int match_depends : 1; - unsigned int match_real_names : 1; + unsigned int match_providers : 1; struct apk_string_array *filters; }; @@ -153,9 +153,12 @@ static void iterate_providers(const struct apk_name *name, const struct list_ctx foreach_array_item(p, name->providers) { - if (ctx->match_real_names && p->pkg->name != name) + if (!ctx->match_providers && p->pkg->name != name) continue; + if (ctx->match_providers) + printf("<%s> ", name->name); + filter_package(p->pkg, ctx); } } @@ -206,10 +209,9 @@ static int option_parse_applet(void *pctx, struct apk_db_options *dbopts, int op break; case 'd': ctx->match_depends = 1; - ctx->match_real_names = 1; break; - case 'r': - ctx->match_real_names = 1; + case 'P': + ctx->match_providers = 1; break; default: return -1; @@ -225,7 +227,7 @@ static const struct apk_option options_applet[] = { { 'u', "upgradable", "List upgradable packages only" }, { 'o', "origin", "List packages by origin" }, { 'd', "depends", "List packages by dependency" }, - { 'r', "real-names", "List packages by real names only" }, + { 'P', "providers", "List packages by provider" }, }; static const struct apk_option_group optgroup_applet = { |