]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: build: enable showing default task in help
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Sun, 22 Nov 2015 19:50:29 +0000 (08:50 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 1 Dec 2015 21:30:55 +0000 (21:30 +0000)
Enable access to the configuration object in register_commands() so that
we can read configuration values there; this allows us to show the
task that will be run in the command line help for the build subcommand.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/devtool
scripts/lib/devtool/build.py

index 2a5a3d41c17521c3152a7374978dd39f29c052d3..1fcb42c1344344df994041c6e3563e4877f6b551 100755 (executable)
@@ -220,6 +220,7 @@ def main():
     config = ConfigHandler(os.path.join(basepath, 'conf', 'devtool.conf'))
     if not config.read():
         return -1
+    context.config = config
 
     bitbake_subdir = config.get('General', 'bitbake_subdir', '')
     if bitbake_subdir:
index 14f55e0f8464d2ee7d44aab4f781895f75a9bb15..0b8e88b8177b13d2dd2b7e01ff67ccd74a420181 100644 (file)
@@ -46,12 +46,14 @@ def _set_file_values(fn, values):
             f.writelines(newlines)
     return updated
 
+def _get_build_task(config):
+    return config.get('Build', 'build_task', 'populate_sysroot')
 
 def build(args, config, basepath, workspace):
     """Entry point for the devtool 'build' subcommand"""
     check_workspace_recipe(workspace, args.recipename)
 
-    build_task = config.get('Build', 'build_task', 'populate_sysroot')
+    build_task = _get_build_task(config)
 
     bbappend = workspace[args.recipename]['bbappend']
     if args.disable_parallel_make:
@@ -71,7 +73,7 @@ def build(args, config, basepath, workspace):
 def register_commands(subparsers, context):
     """Register devtool subcommands from this plugin"""
     parser_build = subparsers.add_parser('build', help='Build a recipe',
-                                         description='Builds the specified recipe using bitbake',
+                                         description='Builds the specified recipe using bitbake (up to and including do_%s)' % _get_build_task(context.config),
                                          formatter_class=argparse.ArgumentDefaultsHelpFormatter)
     parser_build.add_argument('recipename', help='Recipe to build')
     parser_build.add_argument('-s', '--disable-parallel-make', action="store_true", help='Disable make parallelism')