diff options
Diffstat (limited to 'scripts/lib/devtool')
-rw-r--r-- | scripts/lib/devtool/__init__.py | 7 | ||||
-rw-r--r-- | scripts/lib/devtool/standard.py | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index fd2f042ba5..91111e1109 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py | |||
@@ -135,7 +135,12 @@ def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True): | |||
135 | not path.startswith(config.workspace_path)] | 135 | not path.startswith(config.workspace_path)] |
136 | else: | 136 | else: |
137 | append_files = None | 137 | append_files = None |
138 | return tinfoil.parse_recipe_file(recipefile, appends, append_files) | 138 | try: |
139 | rd = tinfoil.parse_recipe_file(recipefile, appends, append_files) | ||
140 | except Exception as e: | ||
141 | logger.error(str(e)) | ||
142 | return None | ||
143 | return rd | ||
139 | 144 | ||
140 | def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False): | 145 | def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False): |
141 | """ | 146 | """ |
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 30b247fa74..5bd498c933 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -224,8 +224,17 @@ def add(args, config, basepath, workspace): | |||
224 | 224 | ||
225 | tinfoil = setup_tinfoil(config_only=True, basepath=basepath) | 225 | tinfoil = setup_tinfoil(config_only=True, basepath=basepath) |
226 | try: | 226 | try: |
227 | rd = tinfoil.parse_recipe_file(recipefile, False) | 227 | try: |
228 | rd = tinfoil.parse_recipe_file(recipefile, False) | ||
229 | except Exception as e: | ||
230 | logger.error(str(e)) | ||
231 | rd = None | ||
228 | if not rd: | 232 | if not rd: |
233 | # Parsing failed. We just created this recipe and we shouldn't | ||
234 | # leave it in the workdir or it'll prevent bitbake from starting | ||
235 | movefn = '%s.parsefailed' % recipefile | ||
236 | logger.error('Parsing newly created recipe failed, moving recipe to %s for reference. If this looks to be caused by the recipe itself, please report this error.' % movefn) | ||
237 | shutil.move(recipefile, movefn) | ||
229 | return 1 | 238 | return 1 |
230 | 239 | ||
231 | if args.fetchuri and not args.no_git: | 240 | if args.fetchuri and not args.no_git: |