mirror of
https://git.yoctoproject.org/poky
synced 2026-03-06 15:29:40 +01:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
cada5a83c7
commit
62989efe6d
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user