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 AB482138334 for ; Sat, 11 May 2019 07:14:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A3681E0882; Sat, 11 May 2019 07:14:53 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 8B4DDE0882 for ; Sat, 11 May 2019 07:14:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 8EDAA34400F for ; Sat, 11 May 2019 07:14:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 26FB05E4 for ; Sat, 11 May 2019 07:14:49 +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: <1557558786.0486e2a62cdce058a9a569940a93dae1f0442f1a.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/atom.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 0486e2a62cdce058a9a569940a93dae1f0442f1a X-VCS-Branch: master Date: Sat, 11 May 2019 07:14:49 +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: 7c34e7db-86de-4072-802c-9a49a2fbd2ce X-Archives-Hash: f579b96d3a6ce563c27ad61e007ddd85 commit: 0486e2a62cdce058a9a569940a93dae1f0442f1a Author: Fabian Groffen gentoo org> AuthorDate: Sat May 11 07:13:06 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat May 11 07:13:06 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=0486e2a6 libq/atom: split out SLOT and SUBSLOT for atom_format it is a bit unclear whether SUBSLOT is part of SLOT or not, but PMS doesn't allow '/' so probably it's supposed to be separate, hence split them up, to format the former combo use %[SLOT]%[SUBSLOT] Signed-off-by: Fabian Groffen gentoo.org> libq/atom.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libq/atom.c b/libq/atom.c index 0eaee5c..5627415 100644 --- a/libq/atom.c +++ b/libq/atom.c @@ -609,7 +609,7 @@ atom_to_string_r(char *buf, size_t buflen, depend_atom *a) * %{keyword}: Always display the field that matches "keyword" or * %[keyword]: Only display the field when it's set (or pverbose) * The possible "keywords" are: - * CATEGORY P PN PV PVR PF PR SLOT REPO USE + * CATEGORY P PN PV PVR PF PR SLOT SUBSLOT REPO USE * - these are all the standard portage variables (so see ebuild(5)) * pfx - the version qualifier if set (e.g. > < = !) * sfx - the version qualifier if set (e.g. *) @@ -695,11 +695,16 @@ atom_format_r( CYAN, atom->PR_int, NORM); } else if (!strncmp("SLOT", fmt, len)) { if (showit || atom->SLOT) - append_buf(buf, buflen, "%s%s%s%s%s%s%s", + append_buf(buf, buflen, "%s%s%s%s", YELLOW, bracket == '[' ? ":" : "", atom->SLOT ? atom->SLOT : "", - atom->SUBSLOT ? "/" : "", + NORM); + } else if (!strncmp("SUBSLOT", fmt, len)) { + if (showit || atom->SUBSLOT) + append_buf(buf, buflen, "%s%s%s%s%s", + YELLOW, + bracket == '[' ? "/" : "", atom->SUBSLOT ? atom->SUBSLOT : "", atom_slotdep_str[atom->slotdep], NORM);