From c203b2fcd4f325e8a2e5ff0e4a2417cd70dcbd6e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 11 Dec 2015 11:26:08 +0530 Subject: [PATCH] Remove extraneous fluff from the dist directory --- setup/installer/windows/freeze.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setup/installer/windows/freeze.py b/setup/installer/windows/freeze.py index 6983e0ffa4..22db63f4ab 100644 --- a/setup/installer/windows/freeze.py +++ b/setup/installer/windows/freeze.py @@ -508,9 +508,13 @@ class Win32Freeze(Command, WixMixIn): def sign_installers(self): self.info('Signing installers...') - files = glob.glob(self.j('dist', '*.msi')) + glob.glob(self.j('dist', - '*.exe')) - if not files: + installers = set() + for f in glob.glob(self.j('dist', '*')): + if f.rpartition('.')[-1].lower() in {'exe', 'msi'}: + installers.add(f) + else: + os.remove(f) + if not installers: raise ValueError('No installers found') args = ['signtool.exe', 'sign', '/a', '/fd', 'sha256', '/td', 'sha256', '/d', 'calibre - E-book management', '/du', @@ -519,7 +523,7 @@ class Win32Freeze(Command, WixMixIn): def runcmd(cmd): for timeserver in ('http://sha256timestamp.ws.symantec.com/sha256/timestamp', 'http://timestamp.comodoca.com/rfc3161',): try: - subprocess.check_call(cmd + [timeserver] + files) + subprocess.check_call(cmd + [timeserver] + list(installers)) break except subprocess.CalledProcessError: print ('Signing failed, retrying with different timestamp server')