* [PATCH 1/2] scripts/oe-setup-builddir: make environment variable the highest priority source for TEMPLATECONF
@ 2022-09-02 12:02 Alexander Kanavin
2022-09-02 12:02 ` [PATCH 2/2] scripts/oe-setup-builddir: write to conf/templateconf.cfg after the build is set up Alexander Kanavin
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kanavin @ 2022-09-02 12:02 UTC (permalink / raw)
To: openembedded-core; +Cc: Alexander Kanavin
This sets the following order:
1. TEMPLATECONF set in the unix environment (for example as a
prefix to '. oe-init-build-env').
2. If empty then $BUILDDIR/conf/templateconf.cfg
3. If absent then $OEROOT/.templateconf (oe-init-build-env sets OEROOT
to where it is, which is poky or oe-core).
I believe this is more logical and consistent with common practice;
it also avoids situations where the user is stuck with cryptic
errors because templateconf.cfg contains something invalid and
that something cannot be overridden from command line.
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
scripts/oe-setup-builddir | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index 32bc6580eb..8e95f0d94e 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -38,7 +38,7 @@ chmod -st "$BUILDDIR/conf" 2>/dev/null || echo "WARNING: unable to chmod $BUILDD
cd "$BUILDDIR"
-if [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then
+if [ -f "$BUILDDIR/conf/templateconf.cfg" -a -z "$TEMPLATECONF" ]; then
TEMPLATECONF=$(cat "$BUILDDIR/conf/templateconf.cfg")
# The following two are no longer valid; unsetting them will automatically get them replaced
# with correct ones.
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH 2/2] scripts/oe-setup-builddir: write to conf/templateconf.cfg after the build is set up
2022-09-02 12:02 [PATCH 1/2] scripts/oe-setup-builddir: make environment variable the highest priority source for TEMPLATECONF Alexander Kanavin
@ 2022-09-02 12:02 ` Alexander Kanavin
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Kanavin @ 2022-09-02 12:02 UTC (permalink / raw)
To: openembedded-core; +Cc: Alexander Kanavin
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-02 12:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-02 12:02 [PATCH 1/2] scripts/oe-setup-builddir: make environment variable the highest priority source for TEMPLATECONF Alexander Kanavin
2022-09-02 12:02 ` [PATCH 2/2] scripts/oe-setup-builddir: write to conf/templateconf.cfg after the build is set up Alexander Kanavin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox