diff options
Diffstat (limited to 'scripts/lib/devtool')
-rw-r--r-- | scripts/lib/devtool/standard.py | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 7e342e7687..0104e675db 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -383,7 +383,7 @@ def extract(args, config, basepath, workspace): | |||
383 | """Entry point for the devtool 'extract' subcommand""" | 383 | """Entry point for the devtool 'extract' subcommand""" |
384 | import bb | 384 | import bb |
385 | 385 | ||
386 | tinfoil = _prep_extract_operation(config, basepath, args.recipename) | 386 | tinfoil = setup_tinfoil(basepath=basepath) |
387 | if not tinfoil: | 387 | if not tinfoil: |
388 | # Error already shown | 388 | # Error already shown |
389 | return 1 | 389 | return 1 |
@@ -407,7 +407,7 @@ def sync(args, config, basepath, workspace): | |||
407 | """Entry point for the devtool 'sync' subcommand""" | 407 | """Entry point for the devtool 'sync' subcommand""" |
408 | import bb | 408 | import bb |
409 | 409 | ||
410 | tinfoil = _prep_extract_operation(config, basepath, args.recipename) | 410 | tinfoil = setup_tinfoil(basepath=basepath) |
411 | if not tinfoil: | 411 | if not tinfoil: |
412 | # Error already shown | 412 | # Error already shown |
413 | return 1 | 413 | return 1 |
@@ -428,29 +428,6 @@ def sync(args, config, basepath, workspace): | |||
428 | tinfoil.shutdown() | 428 | tinfoil.shutdown() |
429 | 429 | ||
430 | 430 | ||
431 | def _prep_extract_operation(config, basepath, recipename, tinfoil=None): | ||
432 | """HACK: Ugly workaround for making sure that requirements are met when | ||
433 | trying to extract a package. Returns the tinfoil instance to be used.""" | ||
434 | if not tinfoil: | ||
435 | tinfoil = setup_tinfoil(basepath=basepath) | ||
436 | |||
437 | rd = parse_recipe(config, tinfoil, recipename, True) | ||
438 | if not rd: | ||
439 | tinfoil.shutdown() | ||
440 | return None | ||
441 | |||
442 | if bb.data.inherits_class('kernel-yocto', rd): | ||
443 | tinfoil.shutdown() | ||
444 | try: | ||
445 | stdout, _ = exec_build_env_command(config.init_path, basepath, | ||
446 | 'bitbake kern-tools-native') | ||
447 | tinfoil = setup_tinfoil(basepath=basepath) | ||
448 | except bb.process.ExecutionError as err: | ||
449 | raise DevtoolError("Failed to build kern-tools-native:\n%s" % | ||
450 | err.stdout) | ||
451 | return tinfoil | ||
452 | |||
453 | |||
454 | def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil): | 431 | def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil): |
455 | """Extract sources of a recipe""" | 432 | """Extract sources of a recipe""" |
456 | import oe.recipeutils | 433 | import oe.recipeutils |
@@ -475,6 +452,9 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil): | |||
475 | raise DevtoolError("The %s recipe has do_unpack disabled, unable to " | 452 | raise DevtoolError("The %s recipe has do_unpack disabled, unable to " |
476 | "extract source" % pn, 4) | 453 | "extract source" % pn, 4) |
477 | 454 | ||
455 | if bb.data.inherits_class('kernel-yocto', d): | ||
456 | tinfoil.build_targets('kern-tools-native') | ||
457 | |||
478 | if not sync: | 458 | if not sync: |
479 | # Prepare for shutil.move later on | 459 | # Prepare for shutil.move later on |
480 | bb.utils.mkdirhier(srctree) | 460 | bb.utils.mkdirhier(srctree) |
@@ -773,13 +753,6 @@ def modify(args, config, basepath, workspace): | |||
773 | raise DevtoolError("--no-extract specified and source path %s does " | 753 | raise DevtoolError("--no-extract specified and source path %s does " |
774 | "not exist or is not a directory" % | 754 | "not exist or is not a directory" % |
775 | srctree) | 755 | srctree) |
776 | if not args.no_extract: | ||
777 | tinfoil = _prep_extract_operation(config, basepath, pn, tinfoil) | ||
778 | if not tinfoil: | ||
779 | # Error already shown | ||
780 | return 1 | ||
781 | # We need to re-parse because tinfoil may have been re-initialised | ||
782 | rd = parse_recipe(config, tinfoil, args.recipename, True) | ||
783 | 756 | ||
784 | recipefile = rd.getVar('FILE') | 757 | recipefile = rd.getVar('FILE') |
785 | appendfile = recipe_to_append(recipefile, config, args.wildcard) | 758 | appendfile = recipe_to_append(recipefile, config, args.wildcard) |