summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-02-19 22:38:56 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-21 09:32:00 +0000
commit82497bde58fc8bdae8d8acfbf025a1a90b14cc3e (patch)
treeff5348861ce155c0434aa0e8da2e79abf608960b
parenteb7787d1652fd84a149fd394969f4f1099406051 (diff)
downloadopenembedded-core-contrib-82497bde58fc8bdae8d8acfbf025a1a90b14cc3e.tar.gz
openembedded-core-contrib-82497bde58fc8bdae8d8acfbf025a1a90b14cc3e.tar.bz2
openembedded-core-contrib-82497bde58fc8bdae8d8acfbf025a1a90b14cc3e.zip
devtool: sdk-update: tweak command-line handling of updateserver
Get the default value for updateserver from the configuration file and show it in the help; also only make the parameter optional if it's specified. This means we can also drop the check in the function as argparse will then ensure it's specified if there's no config setting. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/devtool/sdk.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/lib/devtool/sdk.py b/scripts/lib/devtool/sdk.py
index f6c5434732..fbf2e792e8 100644
--- a/scripts/lib/devtool/sdk.py
+++ b/scripts/lib/devtool/sdk.py
@@ -95,8 +95,6 @@ def sdk_update(args, config, basepath, workspace):
updateserver = args.updateserver
if not updateserver:
updateserver = config.get('SDK', 'updateserver', '')
- if not updateserver:
- raise DevtoolError("Update server not specified in config file, you must specify it on the command line")
logger.debug("updateserver: %s" % updateserver)
# Make sure we are using sdk-update from within SDK
@@ -297,9 +295,14 @@ def register_commands(subparsers, context):
"""Register devtool subcommands from the sdk plugin"""
if context.fixed_setup:
parser_sdk = subparsers.add_parser('sdk-update',
- help='Update SDK components from a nominated location',
+ help='Update SDK components',
+ description='Updates installed SDK components from a remote server',
group='sdk')
- parser_sdk.add_argument('updateserver', help='The update server to fetch latest SDK components from', nargs='?')
+ updateserver = context.config.get('SDK', 'updateserver', '')
+ if updateserver:
+ parser_sdk.add_argument('updateserver', help='The update server to fetch latest SDK components from (default %s)' % updateserver, nargs='?')
+ else:
+ parser_sdk.add_argument('updateserver', help='The update server to fetch latest SDK components from')
parser_sdk.add_argument('--skip-prepare', action="store_true", help='Skip re-preparing the build system after updating (for debugging only)')
parser_sdk.set_defaults(func=sdk_update)