commit: b985ace619b34ff457fa4119e8dabe084695c932 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Sun May 2 10:57:43 2021 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Sun May 2 10:57:43 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b985ace6
qdepends: fix return status when using multiple repos Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> qdepends.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/qdepends.c b/qdepends.c index 865605e..9e2ea0b 100644 --- a/qdepends.c +++ b/qdepends.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2020 Gentoo Authors + * Copyright 2005-2021 Gentoo Authors * Distributed under the terms of the GNU General Public License v2 * * Copyright 2005-2010 Ned Ludd - <[email protected]> @@ -366,6 +366,7 @@ int qdepends_main(int argc, char **argv) if (state.qmode & QMODE_INSTALLED || verbose) state.vdb = tree_open_vdb(portroot, portvdb); + ret = 0; if (state.qmode & QMODE_TREE) { char *overlay; size_t n; @@ -376,11 +377,11 @@ int qdepends_main(int argc, char **argv) if (t != NULL) { if (!(state.qmode & QMODE_REVERSE) && array_cnt(atoms) > 0) { array_for_each(atoms, i, atom) { - ret = tree_foreach_pkg_sorted(t, + ret |= tree_foreach_pkg_sorted(t, qdepends_results_cb, &state, atom); } } else { - ret = tree_foreach_pkg_sorted(t, + ret |= tree_foreach_pkg_sorted(t, qdepends_results_cb, &state, NULL); } tree_close(t); @@ -389,11 +390,11 @@ int qdepends_main(int argc, char **argv) } else { if (!(state.qmode & QMODE_REVERSE) && array_cnt(atoms) > 0) { array_for_each(atoms, i, atom) { - ret = tree_foreach_pkg_fast(state.vdb, + ret |= tree_foreach_pkg_fast(state.vdb, qdepends_results_cb, &state, atom); } } else { - ret = tree_foreach_pkg_fast(state.vdb, + ret |= tree_foreach_pkg_fast(state.vdb, qdepends_results_cb, &state, NULL); } }
