1 |
commit: 262ec2d23a8819c36b6983971dfead24bdd6cbee |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 30 08:00:59 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 30 08:00:59 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=262ec2d2 |
7 |
|
8 |
qcache: suppress keywordless ebuilds in -n mode |
9 |
|
10 |
Only return matches for ebuilds that actually have *any* keywords. |
11 |
|
12 |
Bug: https://bugs.gentoo.org/684252 |
13 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
14 |
|
15 |
qcache.c | 15 ++++++++++++--- |
16 |
1 file changed, 12 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/qcache.c b/qcache.c |
19 |
index 7c5ae42..116f389 100644 |
20 |
--- a/qcache.c |
21 |
+++ b/qcache.c |
22 |
@@ -240,14 +240,23 @@ qcache_imlate(cache_pkg_ctx *pkg_ctx, void *priv) |
23 |
static int |
24 |
qcache_not(cache_pkg_ctx *pkg_ctx, void *priv) |
25 |
{ |
26 |
+ size_t a; |
27 |
qcache_data *data = (qcache_data *)priv; |
28 |
|
29 |
if (data->keywordsbuf[qcache_test_arch] != testing && |
30 |
data->keywordsbuf[qcache_test_arch] != stable) |
31 |
{ |
32 |
- print_keywords(pkg_ctx->cat_ctx->name, pkg_ctx->name, |
33 |
- data->keywordsbuf); |
34 |
- return EXIT_SUCCESS; |
35 |
+ /* match if any of the other arches have keywords */ |
36 |
+ for (a = 0; a < archlist_count; a++) { |
37 |
+ if (data->keywordsbuf[a] == stable || |
38 |
+ data->keywordsbuf[a] == testing) |
39 |
+ break; |
40 |
+ } |
41 |
+ if (a < archlist_count) { |
42 |
+ print_keywords(pkg_ctx->cat_ctx->name, pkg_ctx->name, |
43 |
+ data->keywordsbuf); |
44 |
+ return EXIT_SUCCESS; |
45 |
+ } |
46 |
} |
47 |
|
48 |
return EXIT_FAILURE; |