summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-02-22 11:37:28 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-28 11:33:00 +0000
commit942ae25279bea1b9768112e33f459a9b191d18bd (patch)
tree21f454bc4ea3e1a4e8ae6794ca073e923b22b6bf /scripts/lib/devtool/standard.py
parente2334e126f163f10a8dace110a240ddaafb99dc5 (diff)
downloadpoky-942ae25279bea1b9768112e33f459a9b191d18bd.tar.gz
devtool: modify: fix source tree default name when mapping virtuals
If you for example ran devtool modify virtual/libusb0 without specifying a source tree path, the default was <workspace>/sources/virtual/libusb0 which isn't correct - it should be using the mapped name i.e. libusb-compat (in the default OE-Core configuration). Reorder some of the code to ensure that the mapped name is used. (From OE-Core rev: c51736df17da8e6e561dd5b7ce59cb08254da870) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py35
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
429def _prep_extract_operation(config, basepath, recipename): 429def _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)