1 |
commit: c7d98c2f2c2d98f8296139b19fd3920bc9e5c3fb |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 2 14:06:35 2020 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 2 14:06:35 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c7d98c2f |
7 |
|
8 |
quse: push search atom down to tree_foreach_pkg when applicable |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
quse.c | 14 ++++---------- |
13 |
1 file changed, 4 insertions(+), 10 deletions(-) |
14 |
|
15 |
diff --git a/quse.c b/quse.c |
16 |
index a8585be..358d9e0 100644 |
17 |
--- a/quse.c |
18 |
+++ b/quse.c |
19 |
@@ -426,16 +426,9 @@ quse_results_cb(tree_pkg_ctx *pkg_ctx, void *priv) |
20 |
int portdirfd = -1; /* pacify compiler */ |
21 |
|
22 |
if (state->match || state->do_describe) { |
23 |
- atom = tree_get_atom(pkg_ctx, 0); |
24 |
+ atom = tree_get_atom(pkg_ctx, false); |
25 |
if (atom == NULL) |
26 |
return 0; |
27 |
- |
28 |
- if (state->match) { |
29 |
- match = atom_compare(atom, state->match) == EQUAL; |
30 |
- |
31 |
- if (!match) |
32 |
- return 0; |
33 |
- } |
34 |
} |
35 |
|
36 |
if (!state->do_licence) { |
37 |
@@ -719,14 +712,15 @@ int quse_main(int argc, char **argv) |
38 |
} else if (state.do_installed) { |
39 |
tree_ctx *t = tree_open_vdb(portroot, portvdb); |
40 |
state.overlay = NULL; |
41 |
- tree_foreach_pkg_sorted(t, quse_results_cb, &state, NULL); |
42 |
+ tree_foreach_pkg_sorted(t, quse_results_cb, &state, state.match); |
43 |
tree_close(t); |
44 |
} else { |
45 |
array_for_each(overlays, n, overlay) { |
46 |
tree_ctx *t = tree_open(portroot, overlay); |
47 |
state.overlay = overlay; |
48 |
if (t != NULL) { |
49 |
- tree_foreach_pkg_sorted(t, quse_results_cb, &state, NULL); |
50 |
+ tree_foreach_pkg_sorted(t, quse_results_cb, |
51 |
+ &state, state.match); |
52 |
tree_close(t); |
53 |
} |
54 |
} |