Remove extraneous fluff from the dist directory

This commit is contained in:
Kovid Goyal 2015-12-11 11:26:08 +05:30
parent ed1caccac7
commit c203b2fcd4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -508,9 +508,13 @@ class Win32Freeze(Command, WixMixIn):
def sign_installers(self): def sign_installers(self):
self.info('Signing installers...') self.info('Signing installers...')
files = glob.glob(self.j('dist', '*.msi')) + glob.glob(self.j('dist', installers = set()
'*.exe')) for f in glob.glob(self.j('dist', '*')):
if not files: if f.rpartition('.')[-1].lower() in {'exe', 'msi'}:
installers.add(f)
else:
os.remove(f)
if not installers:
raise ValueError('No installers found') raise ValueError('No installers found')
args = ['signtool.exe', 'sign', '/a', '/fd', 'sha256', '/td', 'sha256', '/d', args = ['signtool.exe', 'sign', '/a', '/fd', 'sha256', '/td', 'sha256', '/d',
'calibre - E-book management', '/du', 'calibre - E-book management', '/du',
@ -519,7 +523,7 @@ class Win32Freeze(Command, WixMixIn):
def runcmd(cmd): def runcmd(cmd):
for timeserver in ('http://sha256timestamp.ws.symantec.com/sha256/timestamp', 'http://timestamp.comodoca.com/rfc3161',): for timeserver in ('http://sha256timestamp.ws.symantec.com/sha256/timestamp', 'http://timestamp.comodoca.com/rfc3161',):
try: try:
subprocess.check_call(cmd + [timeserver] + files) subprocess.check_call(cmd + [timeserver] + list(installers))
break break
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
print ('Signing failed, retrying with different timestamp server') print ('Signing failed, retrying with different timestamp server')