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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CC1C3158094 for ; Sat, 16 Jul 2022 13:44:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 31AEAE0F28; Sat, 16 Jul 2022 13:44:27 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0E26BE0F2A for ; Sat, 16 Jul 2022 13:44:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EE3393410C5 for ; Sat, 16 Jul 2022 13:44:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 43D5553E for ; Sat, 16 Jul 2022 13:44:24 +0000 (UTC) From: "Anna Vyalkova" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anna Vyalkova" Message-ID: <1657979048.329f81b55286f9a72341b2402078fc4f0c46c8f9.cybertailor@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: eclass/ X-VCS-Repository: repo/proj/guru X-VCS-Files: eclass/nim-utils.eclass X-VCS-Directories: eclass/ X-VCS-Committer: cybertailor X-VCS-Committer-Name: Anna Vyalkova X-VCS-Revision: 329f81b55286f9a72341b2402078fc4f0c46c8f9 X-VCS-Branch: dev Date: Sat, 16 Jul 2022 13:44:24 +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: 02f2a705-4706-4350-a44a-b3b93660dc2a X-Archives-Hash: bb3866b75d21176ec80787af8c27dd03 commit: 329f81b55286f9a72341b2402078fc4f0c46c8f9 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Jul 16 07:26:33 2022 +0000 Commit: Anna Vyalkova sysrq in> CommitDate: Sat Jul 16 13:44:08 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=329f81b5 nim-utils.eclass: beautify NOCOLOR stuff Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/nim-utils.eclass | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/eclass/nim-utils.eclass b/eclass/nim-utils.eclass index cdf1d78e3..2cc241ac3 100644 --- a/eclass/nim-utils.eclass +++ b/eclass/nim-utils.eclass @@ -104,6 +104,18 @@ nim_get_buildtype() { fi } +# @FUNCTION: nim_get_colors +# @USAGE: +# @RETURN: "off" if colors should be disabled, "on" otherwise +nim_get_colors() { + debug-print-function ${FUNCNAME} "${@}" + + case ${NOCOLOR} in + true|yes) echo "off" ;; + *) echo "on" ;; + esac +} + # @FUNCTION: nim_gen_config # @USAGE: [] # @DESCRIPTION: @@ -133,8 +145,8 @@ nim_gen_config() { gcc.cpp.options.always:"${CPPFLAGS}" gcc.cpp.options.linker:"${LDFLAGS}" - $([[ "${NOCOLOR}" == true || "${NOCOLOR}" == yes ]] && echo '--colors:"off"') -d:"$(nim_get_buildtype)" + --colors:"$(nim_get_colors)" --parallelBuild:"$(makeopts_jobs)" $(printf "%s\n" ${NIMFLAGS}) EOF