From: Gyorgy Sarvari <skandigraun@gmail.com>
To: proffesionaladdress2@duck.com
Cc: yocto at lists yoctoproject org proffesionaladdress2
<yocto@lists.yoctoproject.org>
Subject: Re: [yocto] warn if a variable is not used
Date: Tue, 8 Apr 2025 15:09:49 +0200 [thread overview]
Message-ID: <0e797561-147b-4aae-aa07-8626f1e3dfc7@gmail.com> (raw)
In-Reply-To: <05B9C867-74DD-4A91-9A1B-1BD33302248A.1@smtp-inbound1.duck.com>
You can check what is actually executed by bitbake. Open the
run.do_compile file to see the actual script after a failure, and see
how it is parsed and where it goes astray.
On 4/8/25 15:06, proffesionaladdress2@duck.com wrote:
> Thank you, but branch is never reached because the previous condition is never true in this code (and I don't know why).
> Even if bbwarn print 'WARNING: rpi-u-boot-scr-1.0-r0 do_compile: isempty=true'.
>
> isempty="${@bb.utils.contains('MY_VARIABLE', '', 'false', 'true', d)}"
> bbwarn "isempty=$isempty"
> if [[ $isempty == true ]]; then
> MY_VARIABLE = "value"
> bbwarn "MY_VARIABLE is not defined, used default: ${MY_VARIABLE}"
> else
> bbwarn "?????"
> fi
>
> But maybe bitbake provide some syntax to print a warning when a variable is not set outside bash code.
> Or it is easier to use some python code.
>
> ----- Mail original -----
> De: "Gyorgy Sarvari" <skandigraun_at_gmail.com_proffesionaladdress2@duck.com>
> À: "yocto at lists yoctoproject org proffesionaladdress2" <yocto_at_lists.yoctoproject.org_proffesionaladdress2@duck.com>, proffesionaladdress2@duck.com
> Envoyé: Mardi 8 Avril 2025 14:56:24
> Objet: Re: [yocto] warn if a variable is not used
>
>> | /<path>/run.do_compile.352486: 153: MY_VARIABLE: not found
> <snip>
>> MY_VARIABLE = "value"
> Note that when you are in do_compile, that's a shell script. You
> shouldn't put space around the equal sign here, because that's not a
> valid syntax to assign a value to a variable in shell.
>
next prev parent reply other threads:[~2025-04-08 13:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 8:15 Yocto on AMD Zen target ? Joel GUITTET
2025-04-04 9:17 ` [yocto] " Khem Raj
2025-04-04 9:34 ` Alexander Kanavin
2025-04-04 9:36 ` Joel GUITTET
[not found] ` <E63C2FBD-D303-4686-B29D-D8306CB27A80.1@smtp-inbound1.duck.com>
2025-04-08 8:23 ` warn if a variable is not used proffesionaladdress2
2025-04-08 8:58 ` proffesionaladdress2
2025-04-08 8:59 ` proffesionaladdress2
2025-04-08 12:56 ` [yocto] " Gyorgy Sarvari
[not found] ` <7A2D6367-3CD1-460F-9655-69A8B0D980A7.1@smtp-inbound1.duck.com>
[not found] ` <05B9C867-74DD-4A91-9A1B-1BD33302248A.1@smtp-inbound1.duck.com>
2025-04-08 13:09 ` Gyorgy Sarvari [this message]
2025-04-08 13:12 ` proffesionaladdress2
2025-04-14 10:58 ` Quentin Schulz
[not found] ` <8417B008-2B4E-42D4-B5A6-E7D31B7D6D3D.1@smtp-inbound1.duck.com>
2025-04-14 13:57 ` proffesionaladdress2
2025-04-08 13:18 ` Clayton Casciato
[not found] ` <4C0F3047-0C25-4038-BA0C-FE81491D89E5.1@smtp-inbound1.duck.com>
2025-04-09 15:32 ` proffesionaladdress2
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=0e797561-147b-4aae-aa07-8626f1e3dfc7@gmail.com \
--to=skandigraun@gmail.com \
--cc=proffesionaladdress2@duck.com \
--cc=yocto@lists.yoctoproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.