mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/idf_tools_py_install_required_v4.0' into 'release/v4.0'
Fix Docker image builds on release/v4.0 See merge request espressif/esp-idf!7551
This commit is contained in:
commit
bbbe6fd449
@ -1093,7 +1093,10 @@ def action_download(args):
|
||||
tool_for_platform = tool_obj.copy_for_platform(platform)
|
||||
tools_info_for_platform[name] = tool_for_platform
|
||||
|
||||
if 'all' in tools_spec:
|
||||
if not tools_spec or 'required' in tools_spec:
|
||||
tools_spec = [k for k, v in tools_info_for_platform.items() if v.get_install_type() == IDFTool.INSTALL_ALWAYS]
|
||||
info('Downloading tools for {}: {}'.format(platform, ', '.join(tools_spec)))
|
||||
elif 'all' in tools_spec:
|
||||
tools_spec = [k for k, v in tools_info_for_platform.items() if v.get_install_type() != IDFTool.INSTALL_NEVER]
|
||||
info('Downloading tools for {}: {}'.format(platform, ', '.join(tools_spec)))
|
||||
|
||||
@ -1112,7 +1115,9 @@ def action_download(args):
|
||||
raise SystemExit(1)
|
||||
if tool_version is None:
|
||||
tool_version = tool_obj.get_recommended_version()
|
||||
assert tool_version is not None
|
||||
if tool_version is None:
|
||||
fatal('tool {} not found for {} platform'.format(tool_name, platform))
|
||||
raise SystemExit(1)
|
||||
tool_spec = '{}@{}'.format(tool_name, tool_version)
|
||||
|
||||
info('Downloading {}'.format(tool_spec))
|
||||
@ -1124,7 +1129,7 @@ def action_download(args):
|
||||
def action_install(args):
|
||||
tools_info = load_tools_info()
|
||||
tools_spec = args.tools
|
||||
if not tools_spec:
|
||||
if not tools_spec or 'required' in tools_spec:
|
||||
tools_spec = [k for k, v in tools_info.items() if v.get_install_type() == IDFTool.INSTALL_ALWAYS]
|
||||
info('Installing tools: {}'.format(', '.join(tools_spec)))
|
||||
elif 'all' in tools_spec:
|
||||
@ -1282,15 +1287,19 @@ def main(argv):
|
||||
'will be used instead. If this flag is given, the version in PATH ' +
|
||||
'will be used.', action='store_true')
|
||||
install = subparsers.add_parser('install', help='Download and install tools into the tools directory')
|
||||
install.add_argument('tools', nargs='*', help='Tools to install. ' +
|
||||
'To install a specific version use tool_name@version syntax.' +
|
||||
'Use \'all\' to install all tools, including the optional ones.')
|
||||
install.add_argument('tools', metavar='TOOL', nargs='*', default=['required'],
|
||||
help='Tools to install. ' +
|
||||
'To install a specific version use <tool_name>@<version> syntax. ' +
|
||||
'Use empty or \'required\' to install required tools, not optional ones. ' +
|
||||
'Use \'all\' to install all tools, including the optional ones.')
|
||||
|
||||
download = subparsers.add_parser('download', help='Download the tools into the dist directory')
|
||||
download.add_argument('--platform', help='Platform to download the tools for')
|
||||
download.add_argument('tools', nargs='+', help='Tools to download. ' +
|
||||
'To download a specific version use tool_name@version syntax.' +
|
||||
'Use \'all\' to download all tools, including the optional ones.')
|
||||
download.add_argument('tools', metavar='TOOL', nargs='*', default=['required'],
|
||||
help='Tools to download. ' +
|
||||
'To download a specific version use <tool_name>@<version> syntax. ' +
|
||||
'Use empty or \'required\' to download required tools, not optional ones. ' +
|
||||
'Use \'all\' to download all tools, including the optional ones.')
|
||||
|
||||
if IDF_MAINTAINER:
|
||||
for subparser in [download, install]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user