diff --git a/tools/build/build.py b/tools/build/build.py index 416b2d4a..2db7696c 100755 --- a/tools/build/build.py +++ b/tools/build/build.py @@ -12,6 +12,20 @@ import sys import tarfile import time +def get_version(): + if os.path.exists('../../.git'): + revision = subprocess.Popen( + ['git', 'rev-list', 'HEAD', '--count'], stdout=subprocess.PIPE + ).communicate()[0].strip() + print revision + revision = int(revision) - 118 + print revision + else: + revision = subprocess.Popen( + ['bzr', 'revno'], stdout=subprocess.PIPE + ).communicate()[0].strip() + return '0.1.%s' % revision + def build_oxjs(downloads=False, geo=False): base_path = os.path.dirname(__file__) @@ -24,10 +38,7 @@ def build_oxjs(downloads=False, geo=False): dev_path = root_path + 'dev/' locales = {} - version = '0.1.%s' % subprocess.Popen( - ['bzr', 'revno'], - stdout=subprocess.PIPE - ).communicate()[0].strip() + version = get_version() year = time.strftime('%Y', time.gmtime()) comment = ' OxJS %s (c) %s 0x2620, dual-licensed GPL/MIT, see https://oxjs.org for details ' % (version, year)