Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: /
Date: Sun, 17 Nov 2019 15:12:39
Message-Id: 1573991518.64dbab476d3a9d287b4d114f66923f0872a08774.grobian@gentoo
1 commit: 64dbab476d3a9d287b4d114f66923f0872a08774
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 17 11:51:58 2019 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 17 11:51:58 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=64dbab47
7
8 qlist: fix -a option
9
10 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
11
12 qlist.c | 27 +++++++++++++--------------
13 1 file changed, 13 insertions(+), 14 deletions(-)
14
15 diff --git a/qlist.c b/qlist.c
16 index e0a8a07..a97111d 100644
17 --- a/qlist.c
18 +++ b/qlist.c
19 @@ -336,23 +336,22 @@ qlist_cb(tree_pkg_ctx *pkg_ctx, void *priv)
20 depend_atom *atom;
21
22 /* see if this cat/pkg is requested */
23 - for (i = optind; i < state->argc; ++i)
24 - if (qlist_match(pkg_ctx, state->argv[i],
25 - &state->atoms[i - optind], state->exact))
26 - break;
27 - if ((i == state->argc) && (state->argc != optind))
28 - return 0;
29 + if (!state->all) {
30 + for (i = optind; i < state->argc; ++i)
31 + if (qlist_match(pkg_ctx, state->argv[i],
32 + &state->atoms[i - optind], state->exact))
33 + break;
34 + if (i == state->argc)
35 + return 0;
36 + }
37
38 atom = tree_get_atom(pkg_ctx, state->need_full_atom);
39 if (state->just_pkgname) {
40 - if ((state->all + state->just_pkgname) < 2) {
41 - printf("%s%s\n",
42 - atom_format(state->fmt, atom),
43 - umapstr(state->show_umap, pkg_ctx));
44 - }
45 + printf("%s%s\n",
46 + atom_format(state->fmt, atom),
47 + umapstr(state->show_umap, pkg_ctx));
48
49 - if (!state->all)
50 - return 1;
51 + return 1;
52 }
53
54 if (verbose)
55 @@ -449,7 +448,7 @@ int qlist_main(int argc, char **argv)
56 /* default to showing syms and objs */
57 if (!state.show_dir && !state.show_obj && !state.show_sym)
58 state.show_obj = state.show_sym = true;
59 - if (argc == optind && !state.just_pkgname)
60 + if (argc == optind && !state.all)
61 qlist_usage(EXIT_FAILURE);
62
63 if (state.fmt == NULL) {