self.track_for_cleanup(self.workspacedir)
self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
# (don't bother with cleaning the recipe on teardown, we won't be building it)
- result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+ # We don't use -x here so that we test the behaviour of devtool modify without it
+ result = runCmd('devtool modify %s %s' % (testrecipe, tempdir))
# Check git repo
self._check_src_repo(tempdir)
# Add a couple of commits
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
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
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")