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 71A23138334 for ; Sun, 17 Nov 2019 15:12:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B76EDE08DA; Sun, 17 Nov 2019 15:12:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 A12BCE08DA for ; Sun, 17 Nov 2019 15:12:38 +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 D17AB34CF33 for ; Sun, 17 Nov 2019 15:12:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5EBDD8CA for ; Sun, 17 Nov 2019 15:12:35 +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: <1573991518.64dbab476d3a9d287b4d114f66923f0872a08774.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qlist.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 64dbab476d3a9d287b4d114f66923f0872a08774 X-VCS-Branch: master Date: Sun, 17 Nov 2019 15:12:35 +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: 7da2cf83-440c-4c11-b616-1fe2538960f3 X-Archives-Hash: c2574ecd251c6b533d056b2a2b974ca6 commit: 64dbab476d3a9d287b4d114f66923f0872a08774 Author: Fabian Groffen gentoo org> AuthorDate: Sun Nov 17 11:51:58 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Nov 17 11:51:58 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=64dbab47 qlist: fix -a option Signed-off-by: Fabian Groffen gentoo.org> qlist.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/qlist.c b/qlist.c index e0a8a07..a97111d 100644 --- a/qlist.c +++ b/qlist.c @@ -336,23 +336,22 @@ qlist_cb(tree_pkg_ctx *pkg_ctx, void *priv) depend_atom *atom; /* see if this cat/pkg is requested */ - for (i = optind; i < state->argc; ++i) - if (qlist_match(pkg_ctx, state->argv[i], - &state->atoms[i - optind], state->exact)) - break; - if ((i == state->argc) && (state->argc != optind)) - return 0; + if (!state->all) { + for (i = optind; i < state->argc; ++i) + if (qlist_match(pkg_ctx, state->argv[i], + &state->atoms[i - optind], state->exact)) + break; + if (i == state->argc) + return 0; + } atom = tree_get_atom(pkg_ctx, state->need_full_atom); if (state->just_pkgname) { - if ((state->all + state->just_pkgname) < 2) { - printf("%s%s\n", - atom_format(state->fmt, atom), - umapstr(state->show_umap, pkg_ctx)); - } + printf("%s%s\n", + atom_format(state->fmt, atom), + umapstr(state->show_umap, pkg_ctx)); - if (!state->all) - return 1; + return 1; } if (verbose) @@ -449,7 +448,7 @@ int qlist_main(int argc, char **argv) /* default to showing syms and objs */ if (!state.show_dir && !state.show_obj && !state.show_sym) state.show_obj = state.show_sym = true; - if (argc == optind && !state.just_pkgname) + if (argc == optind && !state.all) qlist_usage(EXIT_FAILURE); if (state.fmt == NULL) {