Lines Matching refs:args

52 def _check_sha256_by_mark(args, check_url: str, code_dir: str, unzip_dir: str, unzip_filename: str) -> bool:
58 args.mark_file_path = mark_file_path
89 def _uncompress(args, src_file: str, code_dir: str, unzip_dir: str, unzip_filename: str, mark_file_path: str):
100 def _copy_url(args, task_id: int, url: str, local_file: str, code_dir: str, unzip_dir: str,
124 _uncompress(args, local_file, code_dir, unzip_dir, unzip_filename, mark_file_path)
136 def _copy_url_disable_rich(args, url: str, local_file: str, code_dir: str, unzip_dir: str,
152 _uncompress(args, local_file, code_dir, unzip_dir, unzip_filename, mark_file_path)
166 def _hwcloud_download(args, config: dict, bin_dir: str, code_dir: str, glibc_version: str):
174 parse_dict = _config_parse(config_info, args.tool_repo, glibc_version)
183 if _check_sha256_by_mark(args, huaweicloud_url, code_dir, unzip_dir, unzip_filename):
184 if not args.disable_rich:
185 args.progress.console.log('{}, Sha256 markword check OK.'.format(huaweicloud_url), style='green')
194 if not args.disable_rich:
195 args.progress.console.log('{}, Sha256 check download OK.'.format(local_file), style='green')
198 task = pool.submit(_uncompress, args, local_file, code_dir,
199 unzip_dir, unzip_filename, args.mark_file_path)
205 if not args.disable_rich:
206 task_id = args.progress.add_task("download", filename=filename, start=False)
207 task = pool.submit(_copy_url, args, task_id, huaweicloud_url, local_file, code_dir,
208 unzip_dir, unzip_filename, args.mark_file_path, args.progress)
211 task = pool.submit(_copy_url_disable_rich, args, huaweicloud_url, local_file, code_dir,
212 unzip_dir, unzip_filename, args.mark_file_path)
215 if not args.disable_rich:
216 args.progress.console.log('{}, download and decompress completed'.format(tasks.get(task)),
222 def _npm_install(args):
224 os.environ['PATH'] = '{}/{}:{}'.format(args.code_dir, node_path, os.environ.get('PATH'))
225 npm = os.path.join(args.code_dir, node_path, 'npm')
226 if args.skip_ssl:
240 for install_info in args.npm_install_config:
241 full_code_path = os.path.join(args.code_dir, install_info)
250 cmd = ['timeout', '-s', '9', '90s', npm, 'install', '--registry', args.npm_registry, '--cache', npm_cache_dir]
251 if args.host_platform == 'darwin':
252 cmd = [npm, 'install', '--registry', args.npm_registry, '--cache', npm_cache_dir]
253 if args.unsafe_perm:
336 args = config_info.get('args')
337 for arg in args:
359 args = parser.parse_args()
360 args.code_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
361 if args.skip_ssl:
364 host_platform = args.host_platform
365 host_cpu = args.host_cpu
366 glibc_version = args.glibc_version
367 tool_repo = args.tool_repo
368 if args.build_arkuix:
369 config_file = os.path.join(args.code_dir, 'build_plugins/prebuilts_download_config.json')
370 elif args.config_file:
371 config_file = args.config_file
373 config_file = os.path.join(args.code_dir, 'build/prebuilts_download_config.json')
376 args.npm_install_config = config_info.get('npm_install_path')
379 args.npm_install_config = []
383 args.bin_dir = os.path.join(args.code_dir, config_info.get('prebuilts_download_dir'))
384 if not os.path.exists(args.bin_dir):
385 os.makedirs(args.bin_dir, exist_ok=True)
396 if args.disable_rich:
397 _hwcloud_download(args, copy_config, args.bin_dir, args.code_dir, glibc_version)
399 args.progress = _import_rich_module()
400 with args.progress:
401 _hwcloud_download(args, copy_config, args.bin_dir, args.code_dir, glibc_version)
403 _file_handle(file_handle_config, args.code_dir, args.host_platform)
407 result, error = _npm_install(args)
420 _node_modules_copy(node_modules_copy_config, args.code_dir, args.enable_symlink)
422 _install(install_config, args.code_dir)