support building from git mirror
This commit is contained in:
parent
75d53afed5
commit
3b60b42e6b
1 changed files with 15 additions and 4 deletions
|
@ -12,6 +12,20 @@ import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import time
|
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):
|
def build_oxjs(downloads=False, geo=False):
|
||||||
|
|
||||||
base_path = os.path.dirname(__file__)
|
base_path = os.path.dirname(__file__)
|
||||||
|
@ -24,10 +38,7 @@ def build_oxjs(downloads=False, geo=False):
|
||||||
dev_path = root_path + 'dev/'
|
dev_path = root_path + 'dev/'
|
||||||
|
|
||||||
locales = {}
|
locales = {}
|
||||||
version = '0.1.%s' % subprocess.Popen(
|
version = get_version()
|
||||||
['bzr', 'revno'],
|
|
||||||
stdout=subprocess.PIPE
|
|
||||||
).communicate()[0].strip()
|
|
||||||
year = time.strftime('%Y', time.gmtime())
|
year = time.strftime('%Y', time.gmtime())
|
||||||
comment = ' OxJS %s (c) %s 0x2620, dual-licensed GPL/MIT, see https://oxjs.org for details ' % (version, year)
|
comment = ' OxJS %s (c) %s 0x2620, dual-licensed GPL/MIT, see https://oxjs.org for details ' % (version, year)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue