aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2020-05-25 12:37:13 +0200
committerFabian Groffen <grobian@gentoo.org>2020-05-25 12:37:13 +0200
commit53cf6891705c4b953074b5f4bc94b0d53ad9422a (patch)
tree2b2ebdba72ccd1b5c4cf86d8827defb9bf1d4b9d /qatom.c
parentlibq/tree: rework tree_match_atom to return a list of results (diff)
downloadportage-utils-53cf6891705c4b953074b5f4bc94b0d53ad9422a.tar.gz
portage-utils-53cf6891705c4b953074b5f4bc94b0d53ad9422a.tar.bz2
portage-utils-53cf6891705c4b953074b5f4bc94b0d53ad9422a.zip
qatom: adjust to changed tree_match_atom interface
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qatom.c')
-rw-r--r--qatom.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/qatom.c b/qatom.c
index 1c1c50e..a076c49 100644
--- a/qatom.c
+++ b/qatom.c
@@ -122,12 +122,18 @@ int qatom_main(int argc, char **argv)
break;
case _LOOKUP:
{
- tree_pkg_ctx *pkg = tree_match_atom(tree, atom);
+ tree_match_ctx *pkg = tree_match_atom(tree, atom,
+ TREE_MATCH_DEFAULT);
if (pkg != NULL) {
- atomc = tree_get_atom(pkg, true);
- if (!quiet)
- printf("%s: ", atom_to_string(atom));
- printf("%s\n", atom_format(format, atomc));
+ tree_match_ctx *w;
+
+ for (w = pkg; w != NULL; w = w->next) {
+ if (!quiet)
+ printf("%s: ", atom_to_string(atom));
+ printf("%s\n", atom_format(format, w->atom));
+ }
+
+ tree_match_close(pkg);
}
}
}