git version

This commit is contained in:
j 2016-02-18 19:53:49 +05:30
parent 4c30c356c7
commit a3be13e0d5
2 changed files with 7 additions and 11 deletions

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4 # vi:si:et:sw=4:sts=4:ts=4
# GPL 2008-2014 # GPL 2008-2014
__version__ = 'bzr' __version__ = 'git'
from glob import glob from glob import glob

View file

@ -6,19 +6,15 @@ try:
except: except:
from distutils.core import setup from distutils.core import setup
def get_bzr_version(): def get_version():
import os import subprocess
info = os.path.join(os.path.dirname(__file__), '.bzr/branch/last-revision') rev = subprocess.check_output(['git', 'rev-list', 'HEAD', '--count']).strip()
if os.path.exists(info): if rev:
f = open(info) return u'0.%s' % rev
rev = int(f.read().split()[0])
f.close()
if rev:
return u'%s' % rev
return u'unknown' return u'unknown'
setup(name='oxtimelines', setup(name='oxtimelines',
version='0.%s' % get_bzr_version() , version='0.%s' % get_version() ,
scripts=[ scripts=[
'bin/oxtimelines', 'bin/oxtimelines',
], ],