commit: 25853d2ea35884a7f4cf6fefa2a2c53610fc6164 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Thu Dec 15 09:12:10 2022 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Thu Dec 15 09:12:10 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=25853d2e
qkeyword: gracefully handle case with no found arches Bug: https://bugs.gentoo.org/885801 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> qkeyword.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qkeyword.c b/qkeyword.c index f6cdbc2..0989e20 100644 --- a/qkeyword.c +++ b/qkeyword.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2020 Gentoo Foundation + * Copyright 2005-2022 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 * * Copyright 2006 Thomas A. Cort - <[email protected]> @@ -785,6 +785,12 @@ qkeyword_traverse(tree_pkg_cb func, void *priv) array_for_each(overlays, n, overlay) qkeyword_load_arches(overlay); + if (archlist_count == 0 || archlist == NULL) { + warnf("no arches could be found in your active overlays (see q -o), " + "do you have profiles/arch.list files present?\n"); + return EXIT_FAILURE; + } + /* allocate memory (once) for the list used by various funcs */ if (archlist_count > data->keywordsbuflen) { data->keywordsbuf = xrealloc(data->keywordsbuf,
