From e4eb86d3b53e0631b306d02aa3d18a8fc8acfdcd Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 28 Jun 2020 15:50:05 +0100 Subject: [PATCH] Switch setup.py over to using full version string throughout. * .msi filename now uses full A.B.C.D version * Git tag is assumed to be rel-A.B.C.D Switched the entire appcast.write() formatting to using named tags, no need to remember positions now. Addresses part of #523 --- setup.py | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/setup.py b/setup.py index c26dbb8b..6b72a4ad 100755 --- a/setup.py +++ b/setup.py @@ -187,14 +187,14 @@ if sys.platform == 'darwin': if macdeveloperid: os.system('codesign --deep -v -s "Developer ID Application: %s" %s/%s.app' % (macdeveloperid, dist_dir, APPNAME)) # Make zip for distribution, preserving signature - PKG = '%s_mac_%s.zip' % (APPNAME, SHORTVERSION) + PKG = '%s_mac_%s.zip' % (APPNAME, VERSION) os.system('cd %s; ditto -ck --keepParent --sequesterRsrc %s.app ../%s; cd ..' % (dist_dir, APPNAME, PKG)) elif sys.platform == 'win32': os.system(r'"%s\candle.exe" -out %s\ %s.wxs' % (WIXPATH, dist_dir, APPNAME)) if not exists('%s/%s.wixobj' % (dist_dir, APPNAME)): raise AssertionError('No %s/%s.wixobj: candle.exe failed?' % (dist_dir, APPNAME)) - PKG = '%s_win_%s.msi' % (APPNAME, SHORTVERSION) + PKG = '%s_win_%s.msi' % (APPNAME, VERSION) import subprocess os.system(r'"%s\light.exe" -sacl -spdb -sw1076 %s\%s.wixobj -out %s' % (WIXPATH, dist_dir, APPNAME, PKG)) if not exists(PKG): @@ -216,31 +216,32 @@ else: if not exists(PKG): raise AssertionError('No %s found prior to appcast' % (PKG)) # Make appcast entry -appcast = open('appcast_%s_%s.xml' % (sys.platform=='darwin' and 'mac' or 'win', SHORTVERSION), 'w') +appcast = open('appcast_%s_%s.xml' % (sys.platform=='darwin' and 'mac' or 'win', VERSION), 'w') appcast.write(''' \t\t -\t\t\tRelease {0:.2f} +\t\t\tRelease {VERSION} \t\t\t \t\t\t\t{6} -

Release {0:.2f}

+ +

Release {VERSION}

\t\t\t\t]]> \t\t\t
\t\t\t \t\t
-'''.format(float(SHORTVERSION)/100, - SHORTVERSION, - PKG, - sys.platform=='win32' and 'windows"\n\t\t\t\tsparkle:installerArguments="/passive LAUNCH=yes' or 'macos', - VERSION, - os.stat(PKG).st_size, - sys.platform=='win32' and 'body { font-family:"Segoe UI","Tahoma"; font-size: 75%; } h2 { font-family:"Segoe UI","Tahoma"; font-size: 105%; }' or 'h2 { font-size: 105%; }')) +'''.format(VERSION=VERSION, + STYLE='{}'.format( + sys.platform=='win32' and 'body { font-family:"Segoe UI","Tahoma"; font-size: 75%; } h2 { font-family:"Segoe UI","Tahoma"; font-size: 105%; }' + or 'h2 { font-size: 105%; }'), + PKG=PKG, + OS=''.format(sys.platform=='win32' and 'windows"\n\t\t\t\tsparkle:installerArguments="/passive LAUNCH=yes' or 'macos'), + LENGTH=os.stat(PKG).st_size) +)