diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-01-23 00:59:58 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-22 23:42:57 +0000 |
commit | 59682d78f95732e014f78f13e0a05f843860d9bb (patch) | |
tree | ebe1b34b6a5aeefbae1093ce85ace1e0ebd11bff /scripts/lib/devtool | |
parent | 4ffe2e1ec9df05b92a2ad5746fb0ca6d218fd77e (diff) | |
download | openembedded-core-59682d78f95732e014f78f13e0a05f843860d9bb.tar.gz openembedded-core-59682d78f95732e014f78f13e0a05f843860d9bb.tar.bz2 openembedded-core-59682d78f95732e014f78f13e0a05f843860d9bb.zip |
devtool / recipetool: support specifying a subdirectory within the fetched source
Sometimes you don't want to build an entire project, just a subdirectory
of it; add a --src-subdir option to make that easier. (We still look for
a single subdirectory in what gets unpacked, e.g. what you might find
within a tarball, so whatever you specify with this option is added onto
the end of that.)
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')
-rw-r--r-- | scripts/lib/devtool/standard.py | 6 |
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): extracmdopts += ' -b' if args.also_native: extracmdopts += ' --also-native' + if args.src_subdir: + extracmdopts += ' --src-subdir "%s"' % args.src_subdir tempdir = tempfile.mkdtemp(prefix='devtool') try: @@ -208,6 +210,9 @@ def add(args, config, basepath, workspace): if not rd: return 1 + if args.src_subdir: + srctree = os.path.join(srctree, args.src_subdir) + bb.utils.mkdirhier(os.path.dirname(appendfile)) with open(appendfile, 'w') as f: f.write('inherit externalsrc\n') @@ -1308,6 +1313,7 @@ def register_commands(subparsers, context): parser_add.add_argument('--no-git', '-g', help='If fetching source, do not set up source tree as a git repository', action="store_true") 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') 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') + parser_add.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR') parser_add.set_defaults(func=add) parser_modify = subparsers.add_parser('modify', help='Modify the source for an existing recipe', |