diff options
Diffstat (limited to 'scripts/lib/devtool')
| -rw-r--r-- | scripts/lib/devtool/standard.py | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index b707e6e9eb..5f83a91929 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
| @@ -426,10 +426,12 @@ class PatchTaskExecutor(BbTaskExecutor): | |||
| 426 | bb.process.run('git add .; git commit -a -m "Committing changes from %s\n\n%s"' % (func, GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir) | 426 | bb.process.run('git add .; git commit -a -m "Committing changes from %s\n\n%s"' % (func, GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir) |
| 427 | 427 | ||
| 428 | 428 | ||
| 429 | def _prep_extract_operation(config, basepath, recipename): | 429 | def _prep_extract_operation(config, basepath, recipename, tinfoil=None): |
| 430 | """HACK: Ugly workaround for making sure that requirements are met when | 430 | """HACK: Ugly workaround for making sure that requirements are met when |
| 431 | trying to extract a package. Returns the tinfoil instance to be used.""" | 431 | trying to extract a package. Returns the tinfoil instance to be used.""" |
| 432 | tinfoil = setup_tinfoil(basepath=basepath) | 432 | if not tinfoil: |
| 433 | tinfoil = setup_tinfoil(basepath=basepath) | ||
| 434 | |||
| 433 | rd = parse_recipe(config, tinfoil, recipename, True) | 435 | rd = parse_recipe(config, tinfoil, recipename, True) |
| 434 | if not rd: | 436 | if not rd: |
| 435 | return None | 437 | return None |
| @@ -685,33 +687,32 @@ def modify(args, config, basepath, workspace): | |||
| 685 | raise DevtoolError("recipe %s is already in your workspace" % | 687 | raise DevtoolError("recipe %s is already in your workspace" % |
| 686 | args.recipename) | 688 | args.recipename) |
| 687 | 689 | ||
| 690 | tinfoil = setup_tinfoil(basepath=basepath) | ||
| 691 | rd = parse_recipe(config, tinfoil, args.recipename, True) | ||
| 692 | if not rd: | ||
| 693 | return 1 | ||
| 694 | |||
| 695 | pn = rd.getVar('PN', True) | ||
| 696 | if pn != args.recipename: | ||
| 697 | logger.info('Mapping %s to %s' % (args.recipename, pn)) | ||
| 698 | if pn in workspace: | ||
| 699 | raise DevtoolError("recipe %s is already in your workspace" % | ||
| 700 | pn) | ||
| 701 | |||
| 688 | if args.srctree: | 702 | if args.srctree: |
| 689 | srctree = os.path.abspath(args.srctree) | 703 | srctree = os.path.abspath(args.srctree) |
| 690 | else: | 704 | else: |
| 691 | srctree = get_default_srctree(config, args.recipename) | 705 | srctree = get_default_srctree(config, pn) |
| 692 | 706 | ||
| 693 | if args.no_extract and not os.path.isdir(srctree): | 707 | if args.no_extract and not os.path.isdir(srctree): |
| 694 | raise DevtoolError("--no-extract specified and source path %s does " | 708 | raise DevtoolError("--no-extract specified and source path %s does " |
| 695 | "not exist or is not a directory" % | 709 | "not exist or is not a directory" % |
| 696 | srctree) | 710 | srctree) |
| 697 | if not args.no_extract: | 711 | if not args.no_extract: |
| 698 | tinfoil = _prep_extract_operation(config, basepath, args.recipename) | 712 | tinfoil = _prep_extract_operation(config, basepath, pn, tinfoil) |
| 699 | if not tinfoil: | 713 | if not tinfoil: |
| 700 | # Error already shown | 714 | # Error already shown |
| 701 | return 1 | 715 | return 1 |
| 702 | else: | ||
| 703 | tinfoil = setup_tinfoil(basepath=basepath) | ||
| 704 | |||
| 705 | rd = parse_recipe(config, tinfoil, args.recipename, True) | ||
| 706 | if not rd: | ||
| 707 | return 1 | ||
| 708 | |||
| 709 | pn = rd.getVar('PN', True) | ||
| 710 | if pn != args.recipename: | ||
| 711 | logger.info('Mapping %s to %s' % (args.recipename, pn)) | ||
| 712 | if pn in workspace: | ||
| 713 | raise DevtoolError("recipe %s is already in your workspace" % | ||
| 714 | pn) | ||
| 715 | 716 | ||
| 716 | recipefile = rd.getVar('FILE', True) | 717 | recipefile = rd.getVar('FILE', True) |
| 717 | appendfile = recipe_to_append(recipefile, config, args.wildcard) | 718 | appendfile = recipe_to_append(recipefile, config, args.wildcard) |
