diff options
Diffstat (limited to 'scripts/oe-setup-build')
-rwxr-xr-x | scripts/oe-setup-build | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/oe-setup-build b/scripts/oe-setup-build index c0476992a2..49603d9fd1 100755 --- a/scripts/oe-setup-build +++ b/scripts/oe-setup-build | |||
@@ -18,8 +18,7 @@ def makebuildpath(topdir, template): | |||
18 | 18 | ||
19 | def discover_templates(layers_file): | 19 | def discover_templates(layers_file): |
20 | if not os.path.exists(layers_file): | 20 | if not os.path.exists(layers_file): |
21 | print("List of layers {} does not exist; were the layers set up using the setup-layers script?".format(layers_file)) | 21 | raise Exception("List of layers {} does not exist; were the layers set up using the setup-layers script or bitbake-setup tool?".format(layers_file)) |
22 | return None | ||
23 | 22 | ||
24 | templates = [] | 23 | templates = [] |
25 | layers_list = json.load(open(layers_file))["layers"] | 24 | layers_list = json.load(open(layers_file))["layers"] |
@@ -77,8 +76,7 @@ def find_template(template_name, templates): | |||
77 | for t in templates: | 76 | for t in templates: |
78 | if t["templatename"] == template_name: | 77 | if t["templatename"] == template_name: |
79 | return t | 78 | return t |
80 | print("Configuration {} is not one of {}, please try again.".format(tempalte_name, [t["templatename"] for t in templates])) | 79 | raise Exception("Configuration {} is not one of {}, please try again.".format(template_name, [t["templatename"] for t in templates])) |
81 | return None | ||
82 | 80 | ||
83 | def setup_build_env(args): | 81 | def setup_build_env(args): |
84 | templates = discover_templates(args.layerlist) | 82 | templates = discover_templates(args.layerlist) |
@@ -102,9 +100,9 @@ def setup_build_env(args): | |||
102 | 100 | ||
103 | cmd = "TEMPLATECONF={} {}".format(template["templatepath"], cmd_base) | 101 | cmd = "TEMPLATECONF={} {}".format(template["templatepath"], cmd_base) |
104 | if not no_shell: | 102 | if not no_shell: |
105 | cmd = cmd + " && {}".format(os.environ['SHELL']) | 103 | cmd = cmd + " && {}".format(os.environ.get('SHELL','bash')) |
106 | print("Running:", cmd) | 104 | print("Running:", cmd) |
107 | subprocess.run(cmd, shell=True, executable=os.environ['SHELL']) | 105 | subprocess.run(cmd, shell=True, executable=os.environ.get('SHELL','bash')) |
108 | 106 | ||
109 | 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.") | 107 | 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.") |
110 | parser.add_argument("--layerlist", default=defaultlayers(), help='Where to look for available layers (as written out by setup-layers script) (default is {}).'.format(defaultlayers())) | 108 | parser.add_argument("--layerlist", default=defaultlayers(), help='Where to look for available layers (as written out by setup-layers script) (default is {}).'.format(defaultlayers())) |