oe-setup-build: Change how we get the SHELL value

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.

(From OE-Core rev: 9f3099b7eddccf2b7328c0fdd6423269d17138ce)

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ryan Eatmon 2024-09-10 15:17:24 -05:00 committed by Richard Purdie
parent 313afc99ed
commit 40052a34c6

View File

@ -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()))