]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oe-setup-build: Change how we get the SHELL value
authorRyan Eatmon <reatmon@ti.com>
Tue, 10 Sep 2024 20:17:24 +0000 (15:17 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 12 Sep 2024 15:15:06 +0000 (16:15 +0100)
There are times that a user might not have SHELL set for some reason.
We should default back to a known shell in the event that SHELL is not
set.

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/oe-setup-build

index 1cb06b3b793329f79ecc44a4dee6303fb2664d32..80d8c70bacc48d6c0255f0fe561c4de768ae38d6 100755 (executable)
@@ -102,9 +102,9 @@ def setup_build_env(args):
 
     cmd = "TEMPLATECONF={} {}".format(template["templatepath"], cmd_base)
     if not no_shell:
-        cmd = cmd + " && {}".format(os.environ['SHELL'])
+        cmd = cmd + " && {}".format(os.environ.get('SHELL','bash'))
     print("Running:", cmd)
-    subprocess.run(cmd, shell=True, executable=os.environ['SHELL'])
+    subprocess.run(cmd, shell=True, executable=os.environ.get('SHELL','bash'))
 
 parser = argparse.ArgumentParser(description="A script that discovers available build configurations and sets up a build environment based on one of them. Run without arguments to choose one interactively.")
 parser.add_argument("--layerlist", default=defaultlayers(), help='Where to look for available layers (as written out by setup-layers script) (default is {}).'.format(defaultlayers()))