Fix getting commit hash for version info

This commit is contained in:
Philipp Hörist 2016-12-23 20:52:24 +01:00
parent f15497b0c0
commit b43811df88
1 changed files with 9 additions and 7 deletions

View File

@ -23,20 +23,22 @@
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
##
docdir = '../'
basedir = '../'
localedir = '../po'
version = '0.16.10.2'
import subprocess
import sys
import os.path
docdir = '../'
basedir = '../'
localedir = '../po'
version = '0.16.10.2'
try:
node = subprocess.Popen('hg tip --template "{node|short}"', shell=True,
node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
stdout=subprocess.PIPE).communicate()[0]
if node:
version += '-' + node.decode('utf-8')
except Exception:
pass
import sys, os.path
for base in ('.', 'common'):
sys.path.append(os.path.join(base, '.libs'))