From 800880d89199ad42e3808290c8a86469aa25cbfd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 8 Sep 2019 09:06:31 +0530 Subject: [PATCH] Option to not sign installers --- setup/installers.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/setup/installers.py b/setup/installers.py index 369dc93257..0e0b8d65d5 100644 --- a/setup/installers.py +++ b/setup/installers.py @@ -26,14 +26,15 @@ def get_exe(): return 'python3' if sys.version_info.major == 2 else sys.executable -def get_cmd(exe, bypy, which, bitness): +def get_cmd(exe, bypy, which, bitness, sign_installers): cmd = [exe, bypy, which] if bitness and bitness == '32': cmd.append(bitness) cmd.append('program') if not sys.stdout.isatty(): cmd.append('--no-tty') - cmd.append('--sign-installers') + if sign_installers: + cmd.append('--sign-installers') return cmd @@ -51,7 +52,7 @@ def get_dist(base, which, bitness): def build_only(which, bitness, spec, shutdown=False): base, bypy = get_paths() exe = get_exe() - cmd = get_cmd(exe, bypy, which, bitness) + cmd = get_cmd(exe, bypy, which, bitness, False) cmd.extend(['--build-only', spec]) ret = subprocess.Popen(cmd).wait() if ret != 0: @@ -64,10 +65,10 @@ def build_only(which, bitness, spec, shutdown=False): return dist -def build_single(which='windows', bitness='64', shutdown=True): +def build_single(which='windows', bitness='64', shutdown=True, sign_installers=True): base, bypy = get_paths() exe = get_exe() - cmd = get_cmd(exe, bypy, which, bitness) + cmd = get_cmd(exe, bypy, which, bitness, sign_installers) ret = subprocess.Popen(cmd).wait() if ret != 0: raise SystemExit(ret) @@ -108,9 +109,15 @@ class BuildInstaller(Command): action='store_true', help='Do not shutdown the VM after building' ) + parser.add_option( + '--dont-sign', + default=False, + action='store_true', + help='Do not sign the installers' + ) def run(self, opts): - build_single(self.OS, self.BITNESS, not opts.dont_shutdown) + build_single(self.OS, self.BITNESS, not opts.dont_shutdown, not opts.dont_sign) class BuildInstallers(BuildInstaller):