> -----Original Message-----
> From: openembedded-core@lists.openembedded.org 
> <openembedded-core@lists.openembedded.org> On Behalf Of Alexander Kanavin
> Sent: den 24 augusti 2022 14:43
> To: openembedded-core@lists.openembedded.org
> Cc: Alexander Kanavin <a...@linutronix.de>
> Subject: [OE-core] [PATCH 2/2] scripts/oe-setup-builddir: add a check that 
> TEMPLATECONF is valid
> 
> specifically that ../../layer.conf exists, and that second-from-last
> component in the path is 'templates'.

Please no. This happens to match your expectations, but doesn't at 
all match our use of TEMPLATECONF. In our .templateconf we set
TEMPLATECONF=${TEMPLATECONF:-templateconf} and create the templateconf 
directory in runtime where we generate the sample files that match the 
layers that repo has fetched for this particular build. It obviously 
has no layer.conf file as it is in no layer, and the path doesn't 
contain "templates/<something>". I can of course change our tools to 
create a couple of extra directories to match your expectations, but 
at the same time it seems very unnecessary.

> 
> Signed-off-by: Alexander Kanavin <a...@linutronix.de>
> ---
>  scripts/oe-setup-builddir | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
> index 975619789a..db26e3b138 100755
> --- a/scripts/oe-setup-builddir
> +++ b/scripts/oe-setup-builddir
> @@ -61,6 +61,11 @@ if [ -n "$TEMPLATECONF" ]; then
>              echo >&2 "Error: TEMPLATECONF value points to nonexistent 
> directory '$TEMPLATECONF'"
>              exit 1
>          fi
> +        templatesdir=$(python3 -c "import sys; 
> print(sys.argv[1].strip('/').split('/')[-2])" $TEMPLATECONF)
> +        if [ ! -f "$TEMPLATECONF/../../layer.conf" -o $templatesdir != 
> "templates" ]; then
> +            echo >&2 "Error: TEMPLATECONF value must point to 
> meta-some-layer/conf/templates/template-name"
> +            exit 1
> +        fi
>      fi
>      OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
>      OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"
> --
> 2.30.2

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#169818): 
https://lists.openembedded.org/g/openembedded-core/message/169818
Mute This Topic: https://lists.openembedded.org/mt/93225500/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to