[PATCH 2/2] scripts/oe-setup-builddir: write to conf/templateconf.cfg after the build is set up

Alexander Kanavin
2022-09-02T12:02:19Z

This was done before any of the sanity checks or actual setup, which
resulted in templateconf.cfg always getting written out, whether it
would be valid or not, and the user becoming stuck with it.

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

diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index 8e95f0d94e..d3c7f943e7 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -50,10 +50,6 @@ fi

. "$OEROOT"/.templateconf

-if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
- echo "$TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
-fi
-
#
# $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf
#
@@ -140,3 +136,7 @@ if [ -z "$OECORENOTESCONF" ]; then
fi
[ ! -r "$OECORENOTESCONF" ] || cat "$OECORENOTESCONF"
unset OECORENOTESCONF
+
+if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
+ echo "$TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
+fi
--
2.30.2