From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: quentin.schulz@cherry.de, javier.tia@linaro.org,
bitbake-devel@lists.openembedded.org
Cc: docs@lists.yoctoproject.org,
Mikko Rapeli <mikko.rapeli@linaro.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: Re: [docs] [bitbake-devel] [PATCH] doc: Mention `if [[ somecondition ]]` is not supported
Date: Tue, 25 Mar 2025 10:14:43 +0000 [thread overview]
Message-ID: <7275d5d500666f6278ec7937ab15ceb10cdf4f58.camel@linuxfoundation.org> (raw)
In-Reply-To: <0531cca3-683c-4ec3-853c-59da9492c8b6@cherry.de>
On Tue, 2025-03-25 at 11:04 +0100, Quentin Schulz via lists.yoctoproject.org wrote:
>
>
> On 3/20/25 1:33 AM, Javier Tia via lists.openembedded.org wrote:
> > I keep forgetting using `if [[ somecondition ]]` is not supported.
> >
> > Signed-off-by: Javier Tia <javier.tia@linaro.org>
> > ---
> > doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> > index 415fbf6d6..5474e154f 100644
> > --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> > +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> > @@ -1381,6 +1381,10 @@ To make use of this technique, you need the following things in place:
> > To call your modified version of the function as defined in your recipe,
> > call it as ``do_foo``.
> >
> > + .. note::
> > +
> > + Conditional expression using ``[[ somecondition ]]`` is not supported.
> > +
>
> Do you know what the reason is for that limitation?
>
> The example above this git context is not really implying `[[
> somecondition ]]` would be valid though.
>
> If I remember correctly, the shell functions are run by /bin/sh
> interpreter, so it depends on which shell you have configured by default
> in your system. Is it possible this is due to you being used to develop
> with bash where this is possible and having your Yocto build run with a
> different shell (e.g. dash, which doesn't seem to support that? c.f.
> https://manned.org/dash.1)?
>
> I think we should recommend people write POSIX-compliant shell functions
> and tasks rather no?
Bitbake parses the shell functions and our shell parser can't cope with
certain syntax unfortunately.
Cheers,
Richard
next prev parent reply other threads:[~2025-03-25 10:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 0:33 [PATCH] doc: Mention `if [[ somecondition ]]` is not supported Javier Tia
2025-03-25 10:04 ` [bitbake-devel] " Quentin Schulz
2025-03-25 10:14 ` Richard Purdie [this message]
2025-03-25 17:30 ` [docs] " Quentin Schulz
2025-03-25 17:49 ` Richard Purdie
2025-03-27 13:44 ` Antonin Godard
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=7275d5d500666f6278ec7937ab15ceb10cdf4f58.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=bitbake-devel@lists.openembedded.org \
--cc=docs@lists.yoctoproject.org \
--cc=ilias.apalodimas@linaro.org \
--cc=javier.tia@linaro.org \
--cc=mikko.rapeli@linaro.org \
--cc=quentin.schulz@cherry.de \
/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