summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2018-01-29 03:17:07 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2018-01-29 03:17:07 +0000
commitd52285c9aa6f9c76e03f1001e7920ddeb6f6203f (patch)
tree88f26e90ce331203149c5cbe48eb451488feda33
parentd379edd5bf960de8089b9f2083fc6f14b79e7bba (diff)
downloadapk-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
-rw-r--r--src/list.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/list.c b/src/list.c
index 1e61c37..14f5fb5 100644
--- a/src/list.c
+++ b/src/list.c
@@ -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 = {