diff options
| author | Alexander Kanavin <alex@linutronix.de> | 2024-05-07 13:46:21 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-28 09:38:22 +0100 |
| commit | f82c933a4b6de9fb9ee3cc0b56ac8a96be757427 (patch) | |
| tree | 2f8a5a738fb0752db3d7522dc4ce67e38bcc103c /meta/lib/bblayers | |
| parent | 2490d0c12cd69f19e57cad568ab420da40cae830 (diff) | |
| download | poky-f82c933a4b6de9fb9ee3cc0b56ac8a96be757427.tar.gz | |
bblayers/makesetup: raise exceptions when errors happen
Otherwise the calling code can only issue a generic, unhelpful
erorr message, and it's difficult to tell what went wrong
if logger.error output is obscured or redirected.
(From OE-Core rev: 155fe6bda2d715aa616fa8db922dbaa11ebb8080)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/bblayers')
| -rw-r--r-- | meta/lib/bblayers/makesetup.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/lib/bblayers/makesetup.py b/meta/lib/bblayers/makesetup.py index 99d5973760..8148b0d9ff 100644 --- a/meta/lib/bblayers/makesetup.py +++ b/meta/lib/bblayers/makesetup.py | |||
| @@ -48,8 +48,9 @@ class MakeSetupPlugin(LayerPlugin): | |||
| 48 | if l_name == 'workspace': | 48 | if l_name == 'workspace': |
| 49 | continue | 49 | continue |
| 50 | if l_ismodified: | 50 | if l_ismodified: |
| 51 | logger.error("Layer {name} in {path} has uncommitted modifications or is not in a git repository.".format(name=l_name,path=l_path)) | 51 | e = "Layer {name} in {path} has uncommitted modifications or is not in a git repository.".format(name=l_name,path=l_path) |
| 52 | return | 52 | logger.error(e) |
| 53 | raise Exception(e) | ||
| 53 | repo_path = oe.buildcfg.get_metadata_git_toplevel(l_path) | 54 | repo_path = oe.buildcfg.get_metadata_git_toplevel(l_path) |
| 54 | 55 | ||
| 55 | if self._is_submodule(repo_path): | 56 | if self._is_submodule(repo_path): |
| @@ -63,8 +64,9 @@ class MakeSetupPlugin(LayerPlugin): | |||
| 63 | if repo_path == destdir_repo: | 64 | if repo_path == destdir_repo: |
| 64 | repos[repo_path]['contains_this_file'] = True | 65 | repos[repo_path]['contains_this_file'] = True |
| 65 | if not repos[repo_path]['git-remote']['remotes'] and not repos[repo_path]['contains_this_file']: | 66 | if not repos[repo_path]['git-remote']['remotes'] and not repos[repo_path]['contains_this_file']: |
| 66 | logger.error("Layer repository in {path} does not have any remotes configured. Please add at least one with 'git remote add'.".format(path=repo_path)) | 67 | e = "Layer repository in {path} does not have any remotes configured. Please add at least one with 'git remote add'.".format(path=repo_path) |
| 67 | return | 68 | logger.error(e) |
| 69 | raise Exception(e) | ||
| 68 | 70 | ||
| 69 | top_path = os.path.commonpath([os.path.dirname(r) for r in repos.keys()]) | 71 | top_path = os.path.commonpath([os.path.dirname(r) for r in repos.keys()]) |
| 70 | 72 | ||
