summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-02-11 14:13:31 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-11 12:33:03 +0000
commitfa50153bc2c7949a6251e9d5e9b6e97869f07482 (patch)
tree77f64ddf32f82cd33037efe991b89b80ac020c9e /scripts/lib
parentf767757b3ea87ef953558514256fd5e8c93c5f97 (diff)
downloadpoky-fa50153bc2c7949a6251e9d5e9b6e97869f07482.tar.gz
devtool: modify: make -x the default behaviour
It's going to be more common for users not to have the prepared source tree for a recipe already, so the default behaviour ought to be to extract it for them from the recipe. Change the default to extract (effectively making the -x option a no-op) and add a --no-extract/-n option to disable it. Later we can look at trying to be smart and reusing an existing source tree instead of erroring out if it exists; for now this is just the default reversal. (From OE-Core rev: 80a44e52609a89d9ffe816181ae193af491c06ac) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/devtool/standard.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 262ba0989b..f1b2e12345 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -685,11 +685,11 @@ def modify(args, config, basepath, workspace):
685 else: 685 else:
686 srctree = get_default_srctree(config, args.recipename) 686 srctree = get_default_srctree(config, args.recipename)
687 687
688 if not args.extract and not os.path.isdir(srctree): 688 if args.no_extract and not os.path.isdir(srctree):
689 raise DevtoolError("directory %s does not exist or not a directory " 689 raise DevtoolError("--no-extract specified and source path %s does "
690 "(specify -x to extract source from recipe)" % 690 "not exist or is not a directory" %
691 srctree) 691 srctree)
692 if args.extract: 692 if not args.no_extract:
693 tinfoil = _prep_extract_operation(config, basepath, args.recipename) 693 tinfoil = _prep_extract_operation(config, basepath, args.recipename)
694 if not tinfoil: 694 if not tinfoil:
695 # Error already shown 695 # Error already shown
@@ -720,7 +720,7 @@ def modify(args, config, basepath, workspace):
720 720
721 initial_rev = None 721 initial_rev = None
722 commits = [] 722 commits = []
723 if args.extract: 723 if not args.no_extract:
724 initial_rev = _extract_source(srctree, False, args.branch, False, rd) 724 initial_rev = _extract_source(srctree, False, args.branch, False, rd)
725 if not initial_rev: 725 if not initial_rev:
726 return 1 726 return 1
@@ -1319,7 +1319,9 @@ def register_commands(subparsers, context):
1319 parser_modify.add_argument('recipename', help='Name of existing recipe to edit (just name - no version, path or extension)') 1319 parser_modify.add_argument('recipename', help='Name of existing recipe to edit (just name - no version, path or extension)')
1320 parser_modify.add_argument('srctree', nargs='?', help='Path to external source tree. If not specified, a subdirectory of %s will be used.' % defsrctree) 1320 parser_modify.add_argument('srctree', nargs='?', help='Path to external source tree. If not specified, a subdirectory of %s will be used.' % defsrctree)
1321 parser_modify.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend') 1321 parser_modify.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend')
1322 parser_modify.add_argument('--extract', '-x', action="store_true", help='Extract source as well') 1322 group = parser_modify.add_mutually_exclusive_group()
1323 group.add_argument('--extract', '-x', action="store_true", help='Extract source for recipe (default)')
1324 group.add_argument('--no-extract', '-n', action="store_true", help='Do not extract source, expect it to exist')
1323 group = parser_modify.add_mutually_exclusive_group() 1325 group = parser_modify.add_mutually_exclusive_group()
1324 group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true") 1326 group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
1325 group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true") 1327 group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true")