meta/conf/bitbake.conf: add default value for SRCREV

Message ID 20230622165238.25748-1-henning.schild@siemens.com
State Accepted, archived
Headers show
Series meta/conf/bitbake.conf: add default value for SRCREV | expand

Commit Message

Henning Schild June 22, 2023, 4:52 p.m. UTC
The line is taken from the bitbake.conf of OE. The value "INVALID" is
magic and makes bitbake throw exceptions in case the variable needs a
value assigned but a recipe did not assign one.
So it is a minor fix to improve error reporting when recipes have
mistakes.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/conf/bitbake.conf | 1 +
 1 file changed, 1 insertion(+)

Comments

Uladzimir Bely June 30, 2023, 11:57 a.m. UTC | #1
On Thu, 2023-06-22 at 18:52 +0200, 'Henning Schild' via isar-users
wrote:
> The line is taken from the bitbake.conf of OE. The value "INVALID" is
> magic and makes bitbake throw exceptions in case the variable needs a
> value assigned but a recipe did not assign one.
> So it is a minor fix to improve error reporting when recipes have
> mistakes.
> 
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  meta/conf/bitbake.conf | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index a85fea77877e..c122914b2ee9 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -35,6 +35,7 @@ PV = "${@bb.parse.vars_from_file(d.getVar('FILE',
> False),d)[1] or '1.0'}"
>  PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or
> 'r0'}"
>  PROVIDES = ""
>  S = "${WORKDIR}/${P}"
> +SRCREV ??= "INVALID"
>  AUTOREV = "${@bb.fetch2.get_autorev(d)}"
>  AUTOREV[vardepvalue] = "${SRCPV}"
>  # Set Dynamically in base.bbclass
> -- 
> 2.39.3
> 

Applied to next, thanks.

Patch

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index a85fea77877e..c122914b2ee9 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -35,6 +35,7 @@  PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
 PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
 PROVIDES = ""
 S = "${WORKDIR}/${P}"
+SRCREV ??= "INVALID"
 AUTOREV = "${@bb.fetch2.get_autorev(d)}"
 AUTOREV[vardepvalue] = "${SRCPV}"
 # Set Dynamically in base.bbclass