]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oe-setup-build: fix dash support
authorYoann Congal <yoann.congal@smile.fr>
Fri, 26 Sep 2025 14:53:05 +0000 (16:53 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 1 Oct 2025 09:52:51 +0000 (10:52 +0100)
Being minimalist, dash does not support the (non-POSIX) feature of
passing an argument while sourcing a script. Like in
  . <some path>/oe-init-build-env <build dir>

With dash, one must instead use:
  cd <some path>
  set <build dir>       # puts <build dir> in $1
  . ./oe-init-build-env # can only be called from its directory in dash

oe-setup-build generate a sourcable "init-build-env" script, this script
must use the above snippet to be used in dash.

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/oe-setup-build

index 49603d9fd175ba3156079fd5a737e9a6def4af13..edbcd48355a5f55b58f4a4982ca1395215fd7742 100755 (executable)
@@ -89,7 +89,7 @@ def setup_build_env(args):
     builddir = args.b if args.b else template["buildpath"]
     no_shell = args.no_shell
     coredir = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
-    cmd_base = ". {} {}".format(os.path.join(coredir, 'oe-init-build-env'), os.path.abspath(builddir))
+    cmd_base = "cd {}\nset {}\n. ./oe-init-build-env\n".format(coredir, os.path.abspath(builddir))
 
     initbuild = os.path.join(builddir, 'init-build-env')
     if not os.path.exists(initbuild):