kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/idf_tools_download_on-request_tools' into 'master'
idf_tools.py: fix downloading for tools which have "on_request" options See merge request espressif/esp-idf!6757pull/4494/head
commit
60994329ce
|
@ -1065,7 +1065,10 @@ def action_download(args):
|
||||||
tool_for_platform = tool_obj.copy_for_platform(platform)
|
tool_for_platform = tool_obj.copy_for_platform(platform)
|
||||||
tools_info_for_platform[name] = tool_for_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]
|
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)))
|
info('Downloading tools for {}: {}'.format(platform, ', '.join(tools_spec)))
|
||||||
|
|
||||||
|
@ -1084,7 +1087,9 @@ def action_download(args):
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
if tool_version is None:
|
if tool_version is None:
|
||||||
tool_version = tool_obj.get_recommended_version()
|
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)
|
tool_spec = '{}@{}'.format(tool_name, tool_version)
|
||||||
|
|
||||||
info('Downloading {}'.format(tool_spec))
|
info('Downloading {}'.format(tool_spec))
|
||||||
|
@ -1096,7 +1101,7 @@ def action_download(args):
|
||||||
def action_install(args):
|
def action_install(args):
|
||||||
tools_info = load_tools_info()
|
tools_info = load_tools_info()
|
||||||
tools_spec = args.tools
|
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]
|
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)))
|
info('Installing tools: {}'.format(', '.join(tools_spec)))
|
||||||
elif 'all' in tools_spec:
|
elif 'all' in tools_spec:
|
||||||
|
@ -1254,14 +1259,18 @@ def main(argv):
|
||||||
'will be used instead. If this flag is given, the version in PATH ' +
|
'will be used instead. If this flag is given, the version in PATH ' +
|
||||||
'will be used.', action='store_true')
|
'will be used.', action='store_true')
|
||||||
install = subparsers.add_parser('install', help='Download and install tools into the tools directory')
|
install = subparsers.add_parser('install', help='Download and install tools into the tools directory')
|
||||||
install.add_argument('tools', nargs='*', help='Tools to install. ' +
|
install.add_argument('tools', metavar='TOOL', nargs='*', default=['required'],
|
||||||
'To install a specific version use tool_name@version syntax.' +
|
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.')
|
'Use \'all\' to install all tools, including the optional ones.')
|
||||||
|
|
||||||
download = subparsers.add_parser('download', help='Download the tools into the dist directory')
|
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('--platform', help='Platform to download the tools for')
|
||||||
download.add_argument('tools', nargs='+', help='Tools to download. ' +
|
download.add_argument('tools', metavar='TOOL', nargs='*', default=['required'],
|
||||||
'To download a specific version use tool_name@version syntax.' +
|
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.')
|
'Use \'all\' to download all tools, including the optional ones.')
|
||||||
|
|
||||||
if IDF_MAINTAINER:
|
if IDF_MAINTAINER:
|
||||||
|
|
Ładowanie…
Reference in New Issue