diff options
author | Fabian Groffen <grobian@gentoo.org> | 2022-12-15 10:12:10 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2022-12-15 10:12:10 +0100 |
commit | 25853d2ea35884a7f4cf6fefa2a2c53610fc6164 (patch) | |
tree | da110ec9b71bc68f07ca1a3718270598d20eff39 | |
parent | main: Handle empty repo names in parent files (diff) | |
download | portage-utils-25853d2ea35884a7f4cf6fefa2a2c53610fc6164.tar.gz portage-utils-25853d2ea35884a7f4cf6fefa2a2c53610fc6164.tar.bz2 portage-utils-25853d2ea35884a7f4cf6fefa2a2c53610fc6164.zip |
qkeyword: gracefully handle case with no found arches
Bug: https://bugs.gentoo.org/885801
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r-- | qkeyword.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 - <tcort@gentoo.org> @@ -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, |