diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-02-11 14:13:31 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-11 12:32:56 +0000 |
commit | 80a44e52609a89d9ffe816181ae193af491c06ac (patch) | |
tree | ab0f9f5e800d41ed20655473615dcd31bdd763af /scripts/lib/devtool/standard.py | |
parent | e8435fde7f82c39cc0efe1d4bf043b29f63898e9 (diff) | |
download | openembedded-core-80a44e52609a89d9ffe816181ae193af491c06ac.tar.gz openembedded-core-80a44e52609a89d9ffe816181ae193af491c06ac.tar.bz2 openembedded-core-80a44e52609a89d9ffe816181ae193af491c06ac.zip |
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.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.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.py | 14 |
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): else: srctree = get_default_srctree(config, args.recipename) - if not args.extract and not os.path.isdir(srctree): - raise DevtoolError("directory %s does not exist or not a directory " - "(specify -x to extract source from recipe)" % + if args.no_extract and not os.path.isdir(srctree): + raise DevtoolError("--no-extract specified and source path %s does " + "not exist or is not a directory" % srctree) - if args.extract: + if not args.no_extract: tinfoil = _prep_extract_operation(config, basepath, args.recipename) if not tinfoil: # Error already shown @@ -720,7 +720,7 @@ def modify(args, config, basepath, workspace): initial_rev = None commits = [] - if args.extract: + if not args.no_extract: initial_rev = _extract_source(srctree, False, args.branch, False, rd) if not initial_rev: return 1 @@ -1319,7 +1319,9 @@ def register_commands(subparsers, context): parser_modify.add_argument('recipename', help='Name of existing recipe to edit (just name - no version, path or extension)') parser_modify.add_argument('srctree', nargs='?', help='Path to external source tree. If not specified, a subdirectory of %s will be used.' % defsrctree) parser_modify.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend') - parser_modify.add_argument('--extract', '-x', action="store_true", help='Extract source as well') + group = parser_modify.add_mutually_exclusive_group() + group.add_argument('--extract', '-x', action="store_true", help='Extract source for recipe (default)') + group.add_argument('--no-extract', '-n', action="store_true", help='Do not extract source, expect it to exist') group = parser_modify.add_mutually_exclusive_group() group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true") group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true") |