1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-06-04 01:21:03 +03:00

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
This commit is contained in:
Athanasius 2020-06-28 15:50:05 +01:00
parent 70a7ef6337
commit e4eb86d3b5

View File

@ -187,14 +187,14 @@ if sys.platform == 'darwin':
if macdeveloperid: if macdeveloperid:
os.system('codesign --deep -v -s "Developer ID Application: %s" %s/%s.app' % (macdeveloperid, dist_dir, APPNAME)) os.system('codesign --deep -v -s "Developer ID Application: %s" %s/%s.app' % (macdeveloperid, dist_dir, APPNAME))
# Make zip for distribution, preserving signature # 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)) os.system('cd %s; ditto -ck --keepParent --sequesterRsrc %s.app ../%s; cd ..' % (dist_dir, APPNAME, PKG))
elif sys.platform == 'win32': elif sys.platform == 'win32':
os.system(r'"%s\candle.exe" -out %s\ %s.wxs' % (WIXPATH, dist_dir, APPNAME)) os.system(r'"%s\candle.exe" -out %s\ %s.wxs' % (WIXPATH, dist_dir, APPNAME))
if not exists('%s/%s.wixobj' % (dist_dir, APPNAME)): if not exists('%s/%s.wixobj' % (dist_dir, APPNAME)):
raise AssertionError('No %s/%s.wixobj: candle.exe failed?' % (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 import subprocess
os.system(r'"%s\light.exe" -sacl -spdb -sw1076 %s\%s.wixobj -out %s' % (WIXPATH, dist_dir, APPNAME, PKG)) os.system(r'"%s\light.exe" -sacl -spdb -sw1076 %s\%s.wixobj -out %s' % (WIXPATH, dist_dir, APPNAME, PKG))
if not exists(PKG): if not exists(PKG):
@ -216,31 +216,32 @@ else:
if not exists(PKG): if not exists(PKG):
raise AssertionError('No %s found prior to appcast' % (PKG)) raise AssertionError('No %s found prior to appcast' % (PKG))
# Make appcast entry # 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(''' appcast.write('''
\t\t<item> \t\t<item>
\t\t\t<title>Release {0:.2f}</title> \t\t\t<title>Release {VERSION}</title>
\t\t\t<description> \t\t\t<description>
\t\t\t\t<![CDATA[ \t\t\t\t<![CDATA[
<style>{6}</style> <style>{STYLE}</style>
<h2>Release {0:.2f}</h2> <h2>Release {VERSION}</h2>
<ul> <ul>
</ul> </ul>
\t\t\t\t]]> \t\t\t\t]]>
\t\t\t</description> \t\t\t</description>
\t\t\t<enclosure \t\t\t<enclosure
\t\t\t\turl="https://github.com/EDCD/EDMarketConnector/releases/download/rel-{1}/{2}" \t\t\t\turl="https://github.com/EDCD/EDMarketConnector/releases/download/rel-{VERSION}/{PKG}"
\t\t\t\tsparkle:os="{3}" \t\t\t\tsparkle:os="{OS}"
\t\t\t\tsparkle:version="{4}" \t\t\t\tsparkle:version="{VERSION}"
\t\t\t\tlength="{5}" \t\t\t\tlength="{LENGTH}"
\t\t\t\ttype="application/octet-stream" \t\t\t\ttype="application/octet-stream"
\t\t\t/> \t\t\t/>
\t\t</item> \t\t</item>
'''.format(float(SHORTVERSION)/100, '''.format(VERSION=VERSION,
SHORTVERSION, STYLE='{}'.format(
PKG, sys.platform=='win32' and 'body { font-family:"Segoe UI","Tahoma"; font-size: 75%; } h2 { font-family:"Segoe UI","Tahoma"; font-size: 105%; }'
sys.platform=='win32' and 'windows"\n\t\t\t\tsparkle:installerArguments="/passive LAUNCH=yes' or 'macos', or 'h2 { font-size: 105%; }'),
VERSION, PKG=PKG,
os.stat(PKG).st_size, OS=''.format(sys.platform=='win32' and 'windows"\n\t\t\t\tsparkle:installerArguments="/passive LAUNCH=yes' or 'macos'),
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%; }')) LENGTH=os.stat(PKG).st_size)
)