Get the live version from version.py instead of guessing for mac build scripts.

This commit is contained in:
Lexi 2011-07-10 19:54:04 +08:00 committed by Kiooeht
parent 5a107a3341
commit 7e7c8b843f
3 changed files with 34 additions and 5 deletions

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
## Cleanup ## Cleanup
rm -rf build/ dist/ rm -rf build/ dist/
@ -13,7 +13,7 @@ touch dist/Pesterchum.app/Contents/Resources/qt.conf
find dist/Pesterchum.app -iname "*_debug" -exec rm -f '{}' \; find dist/Pesterchum.app -iname "*_debug" -exec rm -f '{}' \;
## Create a dmg file to hold everything ## Create a dmg file to hold everything
VERSION="3.41.2 Beta 5" VERSION=$(python version.py) #"3.41.2 Beta 5"
SIZE=2000 SIZE=2000
name="Pesterchum" name="Pesterchum"
title="${name} ${VERSION}" title="${name} ${VERSION}"

View file

@ -6,13 +6,14 @@ Usage:
""" """
from setuptools import setup from setuptools import setup
from version import lexVersion
APP = ['pesterchum.py'] APP = ['pesterchum.py']
#DATA_FILES = ['pesterchum.js', 'profiles', 'themes', 'smilies', 'logs'] #DATA_FILES = ['pesterchum.js', 'profiles', 'themes', 'smilies', 'logs']
DATA_FILES = ['quirks', 'themes', 'smilies'] DATA_FILES = ['quirks', 'themes', 'smilies']
# TODO: Grep this version out of version.py # TODO: Grep this version out of version.py
SHORT_VERSION = '3.41.2B5' SHORT_VERSION = lexVersion(True) #'3.41.2B5'
LONG_VERSION = '3.41.2 Beta 5 Bleeding Edge' LONG_VERSION = lexVersion() #'3.41.2 Beta 5 Bleeding Edge'
OPTIONS = { OPTIONS = {
'argv_emulation': False, 'argv_emulation': False,
'prefer_ppc': True, 'prefer_ppc': True,

View file

@ -9,7 +9,7 @@ USER_TYPE = "edge"
# edge - new git stuff. bleeding edge, do not try at home (kiooeht version) # edge - new git stuff. bleeding edge, do not try at home (kiooeht version)
_pcMajor = "3.41" _pcMajor = "3.41"
_pcMinor = "0" _pcMinor = "2"
_pcStatus = "B" # A = alpha _pcStatus = "B" # A = alpha
# B = beta # B = beta
# RC = release candidate # RC = release candidate
@ -24,6 +24,34 @@ def pcVerCalc():
else: else:
_pcVersion = "%s.%s.%s" % (_pcMajor, _pcMinor, _pcRevision) _pcVersion = "%s.%s.%s" % (_pcMajor, _pcMinor, _pcRevision)
def lexVersion(short=False):
if not _pcStatus:
return "%s.%s" % (_pcMajor, _pcMinor)
utype = ""
if USER_TYPE == "edge":
utype = "E"
if short:
return "%s.%s%s%s%s" % (_pcMajor, _pcMinor, _pcStatus, _pcRevision, utype);
stype = ""
if _pcStatus == "A":
stype = "Alpha"
elif _pcStatus == "B":
stype = "Beta"
elif _pcStatus == "RC":
stype = "Release Candidate"
if utype == "E":
utype = " Bleeding Edge"
return "%s.%s %s %s%s" % (_pcMajor, _pcMinor, stype, _pcRevision, utype);
# Naughty I know, but it lets me grab it from the bash script.
if __name__ == "__main__":
print lexVersion()
def verStrToNum(ver): def verStrToNum(ver):
w = re.match("(\d+\.?\d+)\.(\d+)-?([A-Za-z]{0,2})\.?(\d*):(\S+)", ver) w = re.match("(\d+\.?\d+)\.(\d+)-?([A-Za-z]{0,2})\.?(\d*):(\S+)", ver)
if not w: if not w: