Option to not sign installers

This commit is contained in:
Kovid Goyal 2019-09-08 09:06:31 +05:30
parent f53a979da9
commit 800880d891
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -26,14 +26,15 @@ def get_exe():
return 'python3' if sys.version_info.major == 2 else sys.executable 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] cmd = [exe, bypy, which]
if bitness and bitness == '32': if bitness and bitness == '32':
cmd.append(bitness) cmd.append(bitness)
cmd.append('program') cmd.append('program')
if not sys.stdout.isatty(): if not sys.stdout.isatty():
cmd.append('--no-tty') cmd.append('--no-tty')
cmd.append('--sign-installers') if sign_installers:
cmd.append('--sign-installers')
return cmd return cmd
@ -51,7 +52,7 @@ def get_dist(base, which, bitness):
def build_only(which, bitness, spec, shutdown=False): def build_only(which, bitness, spec, shutdown=False):
base, bypy = get_paths() base, bypy = get_paths()
exe = get_exe() exe = get_exe()
cmd = get_cmd(exe, bypy, which, bitness) cmd = get_cmd(exe, bypy, which, bitness, False)
cmd.extend(['--build-only', spec]) cmd.extend(['--build-only', spec])
ret = subprocess.Popen(cmd).wait() ret = subprocess.Popen(cmd).wait()
if ret != 0: if ret != 0:
@ -64,10 +65,10 @@ def build_only(which, bitness, spec, shutdown=False):
return dist 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() base, bypy = get_paths()
exe = get_exe() exe = get_exe()
cmd = get_cmd(exe, bypy, which, bitness) cmd = get_cmd(exe, bypy, which, bitness, sign_installers)
ret = subprocess.Popen(cmd).wait() ret = subprocess.Popen(cmd).wait()
if ret != 0: if ret != 0:
raise SystemExit(ret) raise SystemExit(ret)
@ -108,9 +109,15 @@ class BuildInstaller(Command):
action='store_true', action='store_true',
help='Do not shutdown the VM after building' 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): 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): class BuildInstallers(BuildInstaller):