All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/oe-setup-builddir: do not read TEMPLATECONF from templateconf.cfg
@ 2022-09-28 21:18 Alexander Kanavin
  2022-09-28 23:16 ` [OE-core] " Peter Kjellerstedt
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kanavin @ 2022-09-28 21:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

Also, write to it only if it does not already exist.

As discussed here[1], reading from templateconf.cfg serves no purpose:
it exists only if the build directory has already been initialized, and so
the scripts will not change anything in the build directory anyway.

My adjustment is to keep the file however; it is useful as a pointer
to the original template, which can be utilized by config management
tools in the future.

[1] https://lists.openembedded.org/g/openembedded-architecture/topic/template_handling_in_oe_core/93968540

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 scripts/oe-setup-builddir | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index e3c8c6d437..3a91bbf5b1 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -34,16 +34,6 @@ chmod -st "$BUILDDIR/conf" 2>/dev/null || echo "WARNING: unable to chmod $BUILDD
 
 cd "$BUILDDIR" || die "Failed to change directory to $BUILDDIR!"
 
-if [ -z "$TEMPLATECONF" ] && [ -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 ] || [ "$TEMPLATECONF" = meta-poky/conf ]; then
-        unset TEMPLATECONF
-        rm "$BUILDDIR/conf/templateconf.cfg"
-    fi
-fi
-
 . "$OEROOT/.templateconf"
 
 # Keep the original TEMPLATECONF before possibly prefixing it with $OEROOT below.
@@ -132,4 +122,6 @@ fi
 [ ! -r "$OECORENOTESCONF" ] || cat "$OECORENOTESCONF"
 unset OECORENOTESCONF
 
-echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
+if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
+  echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
+fi
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [OE-core] [PATCH] scripts/oe-setup-builddir: do not read TEMPLATECONF from templateconf.cfg
  2022-09-28 21:18 [PATCH] scripts/oe-setup-builddir: do not read TEMPLATECONF from templateconf.cfg Alexander Kanavin
@ 2022-09-28 23:16 ` Peter Kjellerstedt
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Kjellerstedt @ 2022-09-28 23:16 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core@lists.openembedded.org
  Cc: Alexander Kanavin

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Alexander Kanavin
> Sent: den 28 september 2022 23:19
> To: openembedded-core@lists.openembedded.org
> Cc: Alexander Kanavin <alex@linutronix.de>
> Subject: [OE-core] [PATCH] scripts/oe-setup-builddir: do not read TEMPLATECONF from templateconf.cfg
> 
> Also, write to it only if it does not already exist.
> 
> As discussed here[1], reading from templateconf.cfg serves no purpose:
> it exists only if the build directory has already been initialized, and so
> the scripts will not change anything in the build directory anyway.
> 
> My adjustment is to keep the file however; it is useful as a pointer
> to the original template, which can be utilized by config management
> tools in the future.
> 
> [1] https://lists.openembedded.org/g/openembedded-architecture/topic/template_handling_in_oe_core/93968540
> 
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>  scripts/oe-setup-builddir | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
> index e3c8c6d437..3a91bbf5b1 100755
> --- a/scripts/oe-setup-builddir
> +++ b/scripts/oe-setup-builddir
> @@ -34,16 +34,6 @@ chmod -st "$BUILDDIR/conf" 2>/dev/null || echo
> "WARNING: unable to chmod $BUILDD
> 
>  cd "$BUILDDIR" || die "Failed to change directory to $BUILDDIR!"
> 
> -if [ -z "$TEMPLATECONF" ] && [ -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 ] || [ "$TEMPLATECONF" = meta-poky/conf ]; then
> -        unset TEMPLATECONF
> -        rm "$BUILDDIR/conf/templateconf.cfg"
> -    fi
> -fi
> -
>  . "$OEROOT/.templateconf"
> 
>  # Keep the original TEMPLATECONF before possibly prefixing it with
> $OEROOT below.
> @@ -132,4 +122,6 @@ fi
>  [ ! -r "$OECORENOTESCONF" ] || cat "$OECORENOTESCONF"
>  unset OECORENOTESCONF
> 
> -echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
> +if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
> +  echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"

The rest of the file uses four spaces for indentation.
RP: I saw you have this in master-next already so I guess it's easiest 
for you to fix it there.

> +fi
> --
> 2.30.2

//Peter



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-28 23:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-28 21:18 [PATCH] scripts/oe-setup-builddir: do not read TEMPLATECONF from templateconf.cfg Alexander Kanavin
2022-09-28 23:16 ` [OE-core] " Peter Kjellerstedt

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.