public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Florian Schmaus <flow@gentoo.org>
To: Matt Turner <mattst88@gentoo.org>, gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH v2] meson.eclass: allow disabling verbose compilation
Date: Thu, 20 Jul 2023 17:06:02 +0200	[thread overview]
Message-ID: <61b16cf8-9a1c-09c1-ab42-279fae0e0a4a@gentoo.org> (raw)
In-Reply-To: <CAEdQ38H37F8=sUzAehhGuabpt3efqPrUfDHn4Ajw2yfTy_EHYw@mail.gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 2387 bytes --]

On 20/07/2023 17.00, Matt Turner wrote:
> On Wed, Jul 19, 2023 at 3:23 AM Florian Schmaus <flow@gentoo.org> wrote:
>>
>> On 18/07/2023 18.44, Matt Turner wrote:
>>> From: Jonas Rakebrandt <xarblu@protonmail.com>
>>>
>>> This works similar to cmake.eclass's ${CMAKE_VERBOSE}.
>>>
>>> Closes: https://github.com/gentoo/gentoo/pull/28942
>>> Signed-off-by: Jonas Rakebrandt <xarblu@protonmail.com>
>>> Signed-off-by: Matt Turner <mattst88@gentoo.org>
>>> ---
>>>    eclass/meson.eclass | 15 +++++++++++++--
>>>    1 file changed, 13 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/eclass/meson.eclass b/eclass/meson.eclass
>>> index 2c274b213191..3b30f66bf30a 100644
>>> --- a/eclass/meson.eclass
>>> +++ b/eclass/meson.eclass
>>> @@ -55,6 +55,12 @@ BDEPEND=">=dev-util/meson-0.62.2
>>>    # Build directory, location where all generated files should be placed.
>>>    # If this isn't set, it defaults to ${WORKDIR}/${P}-build.
>>>
>>> +# @ECLASS_VARIABLE: MESON_VERBOSE
>>> +# @USER_VARIABLE
>>> +# @DESCRIPTION:
>>> +# Set to OFF to disable verbose messages during compilation
>>> +: "${MESON_VERBOSE:=ON}"
>>> +
>>>    # @ECLASS_VARIABLE: EMESON_BUILDTYPE
>>>    # @DESCRIPTION:
>>>    # The buildtype value to pass to meson setup.
>>> @@ -385,10 +391,15 @@ meson_src_compile() {
>>>                -C "${BUILD_DIR}"
>>>                --jobs "$(makeopts_jobs "${MAKEOPTS}" 0)"
>>>                --load-average "$(makeopts_loadavg "${MAKEOPTS}" 0)"
>>> -             --verbose
>>> -             "$@"
>>>        )
>>>
>>> +     case ${MESON_VERBOSE} in
>>> +             OFF) ;;
>>> +             *) mesoncompileargs+=( --verbose ) ;;
>>> +     esac
>>
>> No strong opinion, just to educate myself, but is there an advantage of
>> using case/easc over if/fi here?
>>
>> That is
>>
>> if [[ ${MESON_VERBOSE} != off ]]; then
>>       mesoncompileargs+=( --verbose )
>> fi
>>
>> or even the shell-style short idiom using ||.
> 
> No advantage as far as I'm aware. I was just copying the style used in
> cmake.eclass.
> 
> I really wish bash just had boolean types :(

While the bash language has no boolean datatype, you can exploit the 
fact that 'true' and 'false' are usually shell builtins:

: "${MESON_VERBOSE:=true}"

and then later

if $MESON_VERBOSE; then
     mesoncompileargs+=( --verbose )
fi

- Flow

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 17273 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 618 bytes --]

  reply	other threads:[~2023-07-20 15:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 14:51 [gentoo-dev] [PATCH] meson.eclass: allow disabling verbose compilation Matt Turner
2023-07-17 14:56 ` Adrian Schollmeyer
2023-07-17 15:24   ` Matt Turner
2023-07-17 15:23 ` [gentoo-dev] " Matt Turner
2023-07-18 16:44 ` [gentoo-dev] [PATCH v2] " Matt Turner
2023-07-19  7:23   ` Florian Schmaus
2023-07-20 15:00     ` Matt Turner
2023-07-20 15:06       ` Florian Schmaus [this message]
2023-07-20 15:08         ` Matt Turner
2023-07-20 15:45         ` Mike Gilbert
2023-07-20 16:58           ` Ulrich Mueller
2023-07-20 17:11             ` Ionen Wolkens
2023-07-20 17:33               ` Ionen Wolkens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61b16cf8-9a1c-09c1-ab42-279fae0e0a4a@gentoo.org \
    --to=flow@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=mattst88@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox