diff options
author | Alexander Kanavin <alex@linutronix.de> | 2024-12-17 15:07:01 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-12-18 11:11:55 +0000 |
commit | 1db6f52e721ad6c970f1907bfe053221eca43e6d (patch) | |
tree | 0d1b6a94f4cb937887a8b26c8aad6cf880723196 /scripts | |
parent | 2fded92cc500f40b1d19a7b28e9734664a4e4b5f (diff) | |
download | poky-1db6f52e721ad6c970f1907bfe053221eca43e6d.tar.gz |
oe-setup-build: raise exceptions on errors
Otherwise the tool simply prints what went wrong and exits without error,
which makes it impossible for tools like bitbake-setup to determine that
the requested operation did not succeed.
(From OE-Core rev: d44ab1c3abb25ef08307558430d76a47cde07cc1)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/oe-setup-build | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/oe-setup-build b/scripts/oe-setup-build index 80d8c70bac..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(template_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) |