From b28e6aead4708a100d60b56a044f36b28a112326 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 20 Mar 2022 21:19:36 -0400 Subject: wrap: add functionality to specify whether insecure downloads should be used We have a fallback route in `meson subprojects download` and friends, which tries to retrieve wrapdb urls via http, if Python was not built with SSL support. Stop doing this. Replace it with a command line option to specify that insecure downloads are wanted, and reference it in the error message if downloading fails due to SSL issues. --- mesonbuild/msubprojects.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mesonbuild/msubprojects.py') diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py index 9e9af2a..accc2b8 100755 --- a/mesonbuild/msubprojects.py +++ b/mesonbuild/msubprojects.py @@ -25,6 +25,7 @@ if T.TYPE_CHECKING: subprojects: T.List[str] types: str subprojects_func: T.Callable[[], bool] + allow_insecure: bool class UpdateArguments(Arguments): rebase: bool @@ -575,6 +576,8 @@ def add_common_arguments(p: argparse.ArgumentParser) -> None: help=f'Comma-separated list of subproject types. Supported types are: {ALL_TYPES_STRING} (default: all)') p.add_argument('--num-processes', default=None, type=int, help='How many parallel processes to use (Since 0.59.0).') + p.add_argument('--allow-insecure', default=False, action='store_true', + help='Allow insecure server connections.') def add_subprojects_argument(p: argparse.ArgumentParser) -> None: p.add_argument('subprojects', nargs='*', @@ -643,7 +646,7 @@ def run(options: 'Arguments') -> int: if not os.path.isdir(subprojects_dir): mlog.log('Directory', mlog.bold(src_dir), 'does not seem to have subprojects.') return 0 - r = Resolver(src_dir, 'subprojects') + r = Resolver(src_dir, 'subprojects', wrap_frontend=True, allow_insecure=options.allow_insecure) if options.subprojects: wraps = [wrap for name, wrap in r.wraps.items() if name in options.subprojects] else: -- cgit v1.1