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 CE5A0138239 for ; Sun, 12 May 2019 09:59:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BD16AE07F1; Sun, 12 May 2019 09:59:00 +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 9F666E07F1 for ; Sun, 12 May 2019 09:59:00 +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 7E620344123 for ; Sun, 12 May 2019 09:58:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6B4EE59F for ; Sun, 12 May 2019 09:58:57 +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: <1557653886.4f72dc4273f0b0ed5dcf7960ddf5c492b39b0df9.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qsize.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 4f72dc4273f0b0ed5dcf7960ddf5c492b39b0df9 X-VCS-Branch: master Date: Sun, 12 May 2019 09:58:57 +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: 920be256-96f1-46cb-be88-11c361e0aeb0 X-Archives-Hash: fb9c47d88c7d60a88c5adac7eb8f760e commit: 4f72dc4273f0b0ed5dcf7960ddf5c492b39b0df9 Author: Fabian Groffen gentoo org> AuthorDate: Sun May 12 09:38:06 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun May 12 09:38:06 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=4f72dc42 qsize: use tree_get_atom Signed-off-by: Fabian Groffen gentoo.org> qsize.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/qsize.c b/qsize.c index 1ae942d..5e9daaa 100644 --- a/qsize.c +++ b/qsize.c @@ -100,8 +100,6 @@ static int qsize_cb(tree_pkg_ctx *pkg_ctx, void *priv) { struct qsize_opt_state *state = priv; - const char *catname = pkg_ctx->cat_ctx->name; - const char *pkgname = pkg_ctx->name; size_t i; depend_atom *atom; FILE *fp; @@ -113,14 +111,12 @@ qsize_cb(tree_pkg_ctx *pkg_ctx, void *priv) if (array_cnt(state->atoms)) { depend_atom *qatom; - snprintf(state->buf, state->buflen, "%s/%s", catname, pkgname); - qatom = atom_explode(state->buf); + qatom = tree_get_atom(pkg_ctx, 0); array_for_each(state->atoms, i, atom) if (atom_compare(atom, qatom) == EQUAL) { showit = true; break; } - atom_implode(qatom); } else showit = true; if (!showit) @@ -164,9 +160,10 @@ qsize_cb(tree_pkg_ctx *pkg_ctx, void *priv) state->num_all_ignored += num_ignored; if (!state->summary_only) { - printf("%s%s/%s%s%s: %'zu files, %'zu non-files, ", BOLD, - catname, BLUE, pkgname, NORM, - num_files, num_nonfiles); + atom = tree_get_atom(pkg_ctx, 0); + printf("%s: %'zu files, %'zu non-files, ", + atom_format("%[CATEGORY]%[PF]", atom, 0), + num_files, num_nonfiles); if (num_ignored) printf("%'zu names-ignored, ", num_ignored); printf("%s %s\n",