get revision from git; make it work everywhere
This commit is contained in:
@@ -38,6 +38,10 @@ AC_SUBST(PYTHONLIBDIR)
|
|||||||
AS_AC_EXPAND(PLUGINSDIR, "\${libdir}/morituri/plugins")
|
AS_AC_EXPAND(PLUGINSDIR, "\${libdir}/morituri/plugins")
|
||||||
AC_MSG_NOTICE(Setting plugins directory to $PLUGINSDIR)
|
AC_MSG_NOTICE(Setting plugins directory to $PLUGINSDIR)
|
||||||
|
|
||||||
|
dnl get git revision for installed.py.in
|
||||||
|
AC_SUBST(REVISION, `python -c 'from morituri.configure import configure; print configure.revision'`)
|
||||||
|
AC_MSG_NOTICE(Setting revision to $REVISION)
|
||||||
|
|
||||||
dnl check for epydoc
|
dnl check for epydoc
|
||||||
AC_CHECK_PROG(EPYDOC, epydoc, yes, no)
|
AC_CHECK_PROG(EPYDOC, epydoc, yes, no)
|
||||||
AM_CONDITIONAL(HAVE_EPYDOC, test "x$EPYDOC" = "xyes")
|
AM_CONDITIONAL(HAVE_EPYDOC, test "x$EPYDOC" = "xyes")
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
import commands
|
||||||
import math
|
import math
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
@@ -331,3 +332,17 @@ class VersionGetter(object):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
return version
|
return version
|
||||||
|
|
||||||
|
|
||||||
|
def getRevision():
|
||||||
|
"""
|
||||||
|
Get a revision tag for the current git source tree.
|
||||||
|
|
||||||
|
Appends -modified in case there are local modifications.
|
||||||
|
"""
|
||||||
|
describe = commands.getoutput('git describe')
|
||||||
|
|
||||||
|
if commands.getoutput('git diff-index --name-only HEAD --'):
|
||||||
|
describe += '-modified'
|
||||||
|
|
||||||
|
return describe
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ import os
|
|||||||
# where am I on the disk ?
|
# where am I on the disk ?
|
||||||
__thisdir = os.path.dirname(os.path.abspath(__file__))
|
__thisdir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
revision = "$Revision$"
|
|
||||||
|
|
||||||
if os.path.exists(os.path.join(__thisdir, 'uninstalled.py')):
|
if os.path.exists(os.path.join(__thisdir, 'uninstalled.py')):
|
||||||
from morituri.configure import uninstalled
|
from morituri.configure import uninstalled
|
||||||
config_dict = uninstalled.get()
|
config_dict = uninstalled.get()
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ def get():
|
|||||||
'isinstalled': True,
|
'isinstalled': True,
|
||||||
'pluginsdir': '@PLUGINSDIR@',
|
'pluginsdir': '@PLUGINSDIR@',
|
||||||
'version': '@VERSION@',
|
'version': '@VERSION@',
|
||||||
|
'revision', '@REVISION@',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
# -*- Mode: Python -*-
|
# -*- Mode: Python -*-
|
||||||
# vi:si:et:sw=4:sts=4:ts=4
|
# vi:si:et:sw=4:sts=4:ts=4
|
||||||
|
|
||||||
import os
|
import os.path
|
||||||
|
|
||||||
|
from morituri.common import common
|
||||||
|
|
||||||
|
|
||||||
__thisdir = os.path.dirname(os.path.abspath(__file__))
|
__thisdir = os.path.dirname(os.path.abspath(__file__))
|
||||||
@@ -13,4 +15,5 @@ def get():
|
|||||||
'pluginsdir': os.path.abspath(os.path.join(
|
'pluginsdir': os.path.abspath(os.path.join(
|
||||||
__thisdir, '..', '..', 'plugins')),
|
__thisdir, '..', '..', 'plugins')),
|
||||||
'version': '@VERSION@',
|
'version': '@VERSION@',
|
||||||
|
'revision': common.getRevision(),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user