From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 340EE138334 for ; Tue, 30 Apr 2019 08:02:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D2B35E0A45; Tue, 30 Apr 2019 08:02:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B9448E0A45 for ; Tue, 30 Apr 2019 08:02:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0A39F342E76 for ; Tue, 30 Apr 2019 08:02:50 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3C7024F6 for ; Tue, 30 Apr 2019 08:02:47 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1556611259.262ec2d23a8819c36b6983971dfead24bdd6cbee.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qcache.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 262ec2d23a8819c36b6983971dfead24bdd6cbee X-VCS-Branch: master Date: Tue, 30 Apr 2019 08:02:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8ab8a161-45b3-4139-8452-40eadc7c39e7 X-Archives-Hash: 0975a2aaa4079d569bd5dc6a3f49cfc8 commit: 262ec2d23a8819c36b6983971dfead24bdd6cbee Author: Fabian Groffen gentoo org> AuthorDate: Tue Apr 30 08:00:59 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Tue Apr 30 08:00:59 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=262ec2d2 qcache: suppress keywordless ebuilds in -n mode Only return matches for ebuilds that actually have *any* keywords. Bug: https://bugs.gentoo.org/684252 Signed-off-by: Fabian Groffen gentoo.org> qcache.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/qcache.c b/qcache.c index 7c5ae42..116f389 100644 --- a/qcache.c +++ b/qcache.c @@ -240,14 +240,23 @@ qcache_imlate(cache_pkg_ctx *pkg_ctx, void *priv) static int qcache_not(cache_pkg_ctx *pkg_ctx, void *priv) { + size_t a; qcache_data *data = (qcache_data *)priv; if (data->keywordsbuf[qcache_test_arch] != testing && data->keywordsbuf[qcache_test_arch] != stable) { - print_keywords(pkg_ctx->cat_ctx->name, pkg_ctx->name, - data->keywordsbuf); - return EXIT_SUCCESS; + /* match if any of the other arches have keywords */ + for (a = 0; a < archlist_count; a++) { + if (data->keywordsbuf[a] == stable || + data->keywordsbuf[a] == testing) + break; + } + if (a < archlist_count) { + print_keywords(pkg_ctx->cat_ctx->name, pkg_ctx->name, + data->keywordsbuf); + return EXIT_SUCCESS; + } } return EXIT_FAILURE;