add mercurial revision to uWSGI version string

This commit is contained in:
roberto@debian2
2011-05-21 07:43:49 +02:00
parent 95432fd8e3
commit 1b859413de
3 changed files with 12 additions and 4 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ class uWSGIDistribution(Distribution):
setup(name='uWSGI',
version='0.9.8-dev',
version=uc.uwsgi_version,
description='The uWSGI server',
author='Unbit',
author_email='info@unbit.it',
-2
View File
@@ -2,8 +2,6 @@
/* indent -i8 -br -brs -brf -l0 -npsl -nip -npcs -npsl -di1 */
#define UWSGI_VERSION "0.9.8-dev"
#define UMAX16 65536
#define uwsgi_error(x) uwsgi_log("%s: %s [%s line %d]\n", x, strerror(errno), __FILE__, __LINE__);
+11 -1
View File
@@ -1,5 +1,7 @@
# uWSGI build system
uwsgi_version = '0.9.8-dev'
import os
import re
import time
@@ -23,6 +25,8 @@ GCC = os.environ.get('CC', sysconfig.get_config_var('CC'))
if not GCC:
GCC = 'gcc'
def spcall(cmd):
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,stderr=open('/dev/null','w'))
@@ -34,6 +38,12 @@ def spcall(cmd):
else:
return None
if uwsgi_version.endswith('-dev') and os.path.exists('%s/.hg' % os.path.dirname(os.path.abspath( __file__ ))):
try:
uwsgi_version += spcall('hg tip --template "-{rev}"')
except:
pass
def spcall2(cmd):
p = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE)
@@ -166,7 +176,7 @@ class uConf(object):
if uwsgi_os == 'Linux':
self.gcc_list.append('lib/linux_ns')
self.gcc_list.append('lib/netlink')
self.cflags = ['-O2', '-Wall', '-Werror', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] + os.environ.get("CFLAGS", "").split()
self.cflags = ['-DUWSGI_VERSION="\\"' + uwsgi_version + '\\""', '-O2', '-Wall', '-Werror', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] + os.environ.get("CFLAGS", "").split()
try:
gcc_version = str(spcall("%s -dumpversion" % GCC))
except: