diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/devtool/standard.py | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index f2621cdb91..e59fb5e567 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -170,7 +170,7 @@ def extract(args, config, basepath, workspace): | |||
170 | """Entry point for the devtool 'extract' subcommand""" | 170 | """Entry point for the devtool 'extract' subcommand""" |
171 | import bb | 171 | import bb |
172 | 172 | ||
173 | tinfoil = setup_tinfoil() | 173 | tinfoil = _prep_extract_operation(config, basepath, args.recipename) |
174 | 174 | ||
175 | rd = parse_recipe(config, tinfoil, args.recipename, True) | 175 | rd = parse_recipe(config, tinfoil, args.recipename, True) |
176 | if not rd: | 176 | if not rd: |
@@ -210,6 +210,24 @@ class BbTaskExecutor(object): | |||
210 | self.executed.append(func) | 210 | self.executed.append(func) |
211 | 211 | ||
212 | 212 | ||
213 | def _prep_extract_operation(config, basepath, recipename): | ||
214 | """HACK: Ugly workaround for making sure that requirements are met when | ||
215 | trying to extract a package. Returns the tinfoil instance to be used.""" | ||
216 | tinfoil = setup_tinfoil() | ||
217 | rd = parse_recipe(config, tinfoil, recipename, True) | ||
218 | |||
219 | if bb.data.inherits_class('kernel-yocto', rd): | ||
220 | tinfoil.shutdown() | ||
221 | try: | ||
222 | stdout, _ = exec_build_env_command(config.init_path, basepath, | ||
223 | 'bitbake kern-tools-native') | ||
224 | tinfoil = setup_tinfoil() | ||
225 | except bb.process.ExecutionError as err: | ||
226 | raise DevtoolError("Failed to build kern-tools-native:\n%s" % | ||
227 | err.stdout) | ||
228 | return tinfoil | ||
229 | |||
230 | |||
213 | def _extract_source(srctree, keep_temp, devbranch, d): | 231 | def _extract_source(srctree, keep_temp, devbranch, d): |
214 | """Extract sources of a recipe""" | 232 | """Extract sources of a recipe""" |
215 | import bb.event | 233 | import bb.event |
@@ -395,8 +413,10 @@ def modify(args, config, basepath, workspace): | |||
395 | raise DevtoolError("directory %s does not exist or not a directory " | 413 | raise DevtoolError("directory %s does not exist or not a directory " |
396 | "(specify -x to extract source from recipe)" % | 414 | "(specify -x to extract source from recipe)" % |
397 | args.srctree) | 415 | args.srctree) |
398 | 416 | if args.extract: | |
399 | tinfoil = setup_tinfoil() | 417 | tinfoil = _prep_extract_operation(config, basepath, args.recipename) |
418 | else: | ||
419 | tinfoil = setup_tinfoil() | ||
400 | 420 | ||
401 | rd = parse_recipe(config, tinfoil, args.recipename, True) | 421 | rd = parse_recipe(config, tinfoil, args.recipename, True) |
402 | if not rd: | 422 | if not rd: |