]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
scripts/oe-setup-builddir: make environment variable the highest priority source...
authorAlexander Kanavin <alex.kanavin@gmail.com>
Fri, 2 Sep 2022 12:02:01 +0000 (14:02 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 3 Sep 2022 07:51:32 +0000 (08:51 +0100)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/oe-setup-builddir

index f4239fea48a1cc425543b29da85b042bbfc18fbe..3c63e38fa9f7792f366822c27a8ff0b95d67c075 100755 (executable)
@@ -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.