summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 5390f51095..f19de27a86 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -141,6 +141,8 @@ def add(args, config, basepath, workspace):
141 extracmdopts += ' -b' 141 extracmdopts += ' -b'
142 if args.also_native: 142 if args.also_native:
143 extracmdopts += ' --also-native' 143 extracmdopts += ' --also-native'
144 if args.src_subdir:
145 extracmdopts += ' --src-subdir "%s"' % args.src_subdir
144 146
145 tempdir = tempfile.mkdtemp(prefix='devtool') 147 tempdir = tempfile.mkdtemp(prefix='devtool')
146 try: 148 try:
@@ -208,6 +210,9 @@ def add(args, config, basepath, workspace):
208 if not rd: 210 if not rd:
209 return 1 211 return 1
210 212
213 if args.src_subdir:
214 srctree = os.path.join(srctree, args.src_subdir)
215
211 bb.utils.mkdirhier(os.path.dirname(appendfile)) 216 bb.utils.mkdirhier(os.path.dirname(appendfile))
212 with open(appendfile, 'w') as f: 217 with open(appendfile, 'w') as f:
213 f.write('inherit externalsrc\n') 218 f.write('inherit externalsrc\n')
@@ -1308,6 +1313,7 @@ def register_commands(subparsers, context):
1308 parser_add.add_argument('--no-git', '-g', help='If fetching source, do not set up source tree as a git repository', action="store_true") 1313 parser_add.add_argument('--no-git', '-g', help='If fetching source, do not set up source tree as a git repository', action="store_true")
1309 parser_add.add_argument('--binary', '-b', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure). Useful with binary packages e.g. RPMs.', action='store_true') 1314 parser_add.add_argument('--binary', '-b', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure). Useful with binary packages e.g. RPMs.', action='store_true')
1310 parser_add.add_argument('--also-native', help='Also add native variant (i.e. support building recipe for the build host as well as the target machine)', action='store_true') 1315 parser_add.add_argument('--also-native', help='Also add native variant (i.e. support building recipe for the build host as well as the target machine)', action='store_true')
1316 parser_add.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR')
1311 parser_add.set_defaults(func=add) 1317 parser_add.set_defaults(func=add)
1312 1318
1313 parser_modify = subparsers.add_parser('modify', help='Modify the source for an existing recipe', 1319 parser_modify = subparsers.add_parser('modify', help='Modify the source for an existing recipe',