diff options
author | 2020-01-02 14:23:35 +0100 | |
---|---|---|
committer | 2020-01-02 14:23:35 +0100 | |
commit | 2d78938f5d4c3be536e7484c0f23be64b124db05 (patch) | |
tree | a2119824c8deca5811573120a845b3851e2da911 /qdepends.c | |
parent | libq/tree: fix bug after realloc in metadata Q__data (diff) | |
download | portage-utils-2d78938f5d4c3be536e7484c0f23be64b124db05.tar.gz portage-utils-2d78938f5d4c3be536e7484c0f23be64b124db05.tar.bz2 portage-utils-2d78938f5d4c3be536e7484c0f23be64b124db05.zip |
qdepends: use tree_foreach_pkg query selection on forward queries
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qdepends.c')
-rw-r--r-- | qdepends.c | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -375,14 +375,28 @@ int qdepends_main(int argc, char **argv) array_for_each(overlays, n, overlay) { t = tree_open(portroot, overlay); if (t != NULL) { - ret = tree_foreach_pkg_sorted(t, - qdepends_results_cb, &state, NULL); + if (!(state.qmode & QMODE_REVERSE) && array_cnt(atoms) > 0) { + array_for_each(atoms, i, atom) { + ret = tree_foreach_pkg_sorted(t, + qdepends_results_cb, &state, atom); + } + } else { + ret = tree_foreach_pkg_sorted(t, + qdepends_results_cb, &state, NULL); + } tree_close(t); } } } else { - ret = tree_foreach_pkg_fast(state.vdb, - qdepends_results_cb, &state, NULL); + if (!(state.qmode & QMODE_REVERSE) && array_cnt(atoms) > 0) { + array_for_each(atoms, i, atom) { + ret = tree_foreach_pkg_fast(state.vdb, + qdepends_results_cb, &state, atom); + } + } else { + ret = tree_foreach_pkg_fast(state.vdb, + qdepends_results_cb, &state, NULL); + } } if (state.vdb != NULL) |