commit:     53cf6891705c4b953074b5f4bc94b0d53ad9422a
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon May 25 10:37:13 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon May 25 10:37:13 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=53cf6891

qatom: adjust to changed tree_match_atom interface

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 qatom.c | 16 +++++++++++-----
 1 file 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);
                                }
                        }
                }

Reply via email to