summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/devtool.py3
-rw-r--r--scripts/lib/devtool/standard.py14
2 files changed, 10 insertions, 7 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index d95cb08749..345cabbda9 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -570,7 +570,8 @@ class DevtoolTests(DevtoolBase):
570 self.track_for_cleanup(self.workspacedir) 570 self.track_for_cleanup(self.workspacedir)
571 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') 571 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
572 # (don't bother with cleaning the recipe on teardown, we won't be building it) 572 # (don't bother with cleaning the recipe on teardown, we won't be building it)
573 result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) 573 # We don't use -x here so that we test the behaviour of devtool modify without it
574 result = runCmd('devtool modify %s %s' % (testrecipe, tempdir))
574 # Check git repo 575 # Check git repo
575 self._check_src_repo(tempdir) 576 self._check_src_repo(tempdir)
576 # Add a couple of commits 577 # Add a couple of commits
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")