summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/sdk.py
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:42 +0000
commit62989efe6d65d438f578dbeb8a8831d900dac891 (patch)
tree798f057b40ebb755e4516811caa64a46cf39389e /scripts/lib/devtool/sdk.py
parentcada5a83c7850e6f11c8943f22d50dd6dfe957de (diff)
downloadpoky-62989efe6d65d438f578dbeb8a8831d900dac891.tar.gz
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. (From OE-Core rev: 82497bde58fc8bdae8d8acfbf025a1a90b14cc3e) 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/sdk.py')
-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):
95 updateserver = args.updateserver 95 updateserver = args.updateserver
96 if not updateserver: 96 if not updateserver:
97 updateserver = config.get('SDK', 'updateserver', '') 97 updateserver = config.get('SDK', 'updateserver', '')
98 if not updateserver:
99 raise DevtoolError("Update server not specified in config file, you must specify it on the command line")
100 logger.debug("updateserver: %s" % updateserver) 98 logger.debug("updateserver: %s" % updateserver)
101 99
102 # Make sure we are using sdk-update from within SDK 100 # Make sure we are using sdk-update from within SDK
@@ -297,9 +295,14 @@ def register_commands(subparsers, context):
297 """Register devtool subcommands from the sdk plugin""" 295 """Register devtool subcommands from the sdk plugin"""
298 if context.fixed_setup: 296 if context.fixed_setup:
299 parser_sdk = subparsers.add_parser('sdk-update', 297 parser_sdk = subparsers.add_parser('sdk-update',
300 help='Update SDK components from a nominated location', 298 help='Update SDK components',
299 description='Updates installed SDK components from a remote server',
301 group='sdk') 300 group='sdk')
302 parser_sdk.add_argument('updateserver', help='The update server to fetch latest SDK components from', nargs='?') 301 updateserver = context.config.get('SDK', 'updateserver', '')
302 if updateserver:
303 parser_sdk.add_argument('updateserver', help='The update server to fetch latest SDK components from (default %s)' % updateserver, nargs='?')
304 else:
305 parser_sdk.add_argument('updateserver', help='The update server to fetch latest SDK components from')
303 parser_sdk.add_argument('--skip-prepare', action="store_true", help='Skip re-preparing the build system after updating (for debugging only)') 306 parser_sdk.add_argument('--skip-prepare', action="store_true", help='Skip re-preparing the build system after updating (for debugging only)')
304 parser_sdk.set_defaults(func=sdk_update) 307 parser_sdk.set_defaults(func=sdk_update)
305 308