1 |
commit: 74a6ea62eb1b9c9ab4c6ed3402e9c7d7e618ceb4 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 2 11:43:10 2020 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 2 11:43:10 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=74a6ea62 |
7 |
|
8 |
libq/tree: activate atom query |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
libq/tree.c | 11 ++++++----- |
13 |
1 file changed, 6 insertions(+), 5 deletions(-) |
14 |
|
15 |
diff --git a/libq/tree.c b/libq/tree.c |
16 |
index 8996e55..0fdf9b1 100644 |
17 |
--- a/libq/tree.c |
18 |
+++ b/libq/tree.c |
19 |
@@ -1192,8 +1192,7 @@ tree_close_pkg(tree_pkg_ctx *pkg_ctx) |
20 |
} |
21 |
|
22 |
static int |
23 |
-tree_foreach_packages(tree_ctx *ctx, tree_pkg_cb callback, |
24 |
- void *priv, depend_atom *query) |
25 |
+tree_foreach_packages(tree_ctx *ctx, tree_pkg_cb callback, void *priv) |
26 |
{ |
27 |
char *p = ctx->pkgs; |
28 |
char *q; |
29 |
@@ -1201,6 +1200,7 @@ tree_foreach_packages(tree_ctx *ctx, tree_pkg_cb callback, |
30 |
char pkgname[_Q_PATH_MAX]; |
31 |
size_t len = ctx->pkgslen; |
32 |
int ret = 0; |
33 |
+ depend_atom *query = ctx->query_atom; |
34 |
|
35 |
/* reused for every entry */ |
36 |
tree_cat_ctx *cat = NULL; |
37 |
@@ -1323,11 +1323,12 @@ tree_foreach_pkg(tree_ctx *ctx, tree_pkg_cb callback, void *priv, |
38 |
if (ctx == NULL) |
39 |
return EXIT_FAILURE; |
40 |
|
41 |
+ ctx->do_sort = sort; |
42 |
+ ctx->query_atom = query; |
43 |
+ |
44 |
/* handle Packages (binpkgs index) file separately */ |
45 |
if (ctx->cachetype == CACHE_PACKAGES) |
46 |
- return tree_foreach_packages(ctx, callback, priv, query); |
47 |
- |
48 |
- ctx->do_sort = sort; |
49 |
+ return tree_foreach_packages(ctx, callback, priv); |
50 |
|
51 |
ret = 0; |
52 |
while ((cat_ctx = tree_next_cat(ctx))) { |