support building from git mirror

This commit is contained in:
j 2014-05-10 22:39:13 +02:00
parent 75d53afed5
commit 3b60b42e6b

View file

@ -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)