aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2022-12-15 10:12:10 +0100
committerFabian Groffen <grobian@gentoo.org>2022-12-15 10:12:10 +0100
commit25853d2ea35884a7f4cf6fefa2a2c53610fc6164 (patch)
treeda110ec9b71bc68f07ca1a3718270598d20eff39
parentmain: Handle empty repo names in parent files (diff)
downloadportage-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.c8
1 files changed, 7 insertions, 1 deletions
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 - <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,