> -----Original Message-----
> From: [email protected] 
> <[email protected]> On Behalf Of Alexander Kanavin
> Sent: den 1 september 2022 16:23
> To: [email protected]
> Cc: Alexander Kanavin <[email protected]>
> Subject: [OE-core] [PATCH] scripts/oe-setup-builddir: migrate 
> build/conf/templateconf.cfg to new template locations
> 
> This is done only for default oe-core/poky templates; for anything
> else the locations themselves need to be migrated first, and there
> is no way to tell where they would be.
> 
> Signed-off-by: Alexander Kanavin <[email protected]>
> ---
>  scripts/oe-setup-builddir | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
> index bf832ee0ca..32bc6580eb 100755
> --- a/scripts/oe-setup-builddir
> +++ b/scripts/oe-setup-builddir
> @@ -40,6 +40,12 @@ cd "$BUILDDIR"
> 
>  if [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then
>      TEMPLATECONF=$(cat "$BUILDDIR/conf/templateconf.cfg")
> +    # The following two are no longer valid; unsetting them will 
> automatically get them replaced
> +    # with correct ones.
> +    if [ $TEMPLATECONF = "meta/conf" -o $TEMPLATECONF = "meta-poky/conf" ]; 
> then
> +        unset TEMPLATECONF
> +        rm $BUILDDIR/conf/templateconf.cfg
> +    fi

Since the test you added previously now requires that the path contains 
"/templates/", we might as well do this for any faulty configuration. I.e.:

    # The path in $TEMPLATECONF must contain "/templates/". If it doesn't, 
    # unset it to have it replaced by a (hopefully) correct path.
    case $TEMPLATECONF in
        */templates/*)
            ;;
        *)
            unset TEMPLATECONF
            rm "$BUILDDIR/conf/templateconf.cfg"
            ;;
    esac

If .templateconf hasn't been updated to comply with the new rules, the 
test later will point this out. But if it has been updated, the case 
statement above will avoid the problem of an old, non-complying 
configuration regardless of which layer it comes from.

>  fi
> 
>  . "$OEROOT"/.templateconf
> --
> 2.30.2

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170232): 
https://lists.openembedded.org/g/openembedded-core/message/170232
Mute This Topic: https://lists.openembedded.org/mt/93396426/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to