- added --git-revision to mapnik-config

- related to #903
This commit is contained in:
kunitoki 2011-10-19 00:22:47 +02:00
parent 8ed3b4aa0d
commit 31f42bd5c1
2 changed files with 19 additions and 9 deletions

View file

@ -10,7 +10,7 @@ config_env = env.Clone()
# TODO
# major/minor versions
# git hash
# git rev-list --max-count=1 HEAD
config_variables = '''#!/bin/sh
@ -26,6 +26,7 @@ CONFIG_DEP_LIBS='%(dep_libs)s'
CONFIG_OTHER_INCLUDES='%(other_includes)s'
CONFIG_FONTS='%(fonts)s'
CONFIG_INPUT_PLUGINS='%(input_plugins)s'
CONFIG_GIT_REVISION='%(git_revision)s'
CONFIG_SVN_REVISION='%(svn_revision)s'
CONFIG_JSON="{
@ -39,7 +40,8 @@ CONFIG_JSON="{
\\"other_includes\\": \\"${CONFIG_OTHER_INCLUDES}\\",
\\"fonts\\": \\"${CONFIG_FONTS}\\",
\\"input_plugins\\": \\"${CONFIG_INPUT_PLUGINS}\\",
\\"svn_revision\\": ${CONFIG_SVN_REVISION}
\\"git_revision\\": \\"${CONFIG_GIT_REVISION}\\",
\\"svn_revision\\": ${CONFIG_SVN_REVISION},
}"
'''
@ -73,6 +75,8 @@ dep_libs = ''.join([' -l%s' % i for i in env['LIBMAPNIK_LIBS']])
if env['INTERNAL_LIBAGG']:
dep_libs = dep_libs.replace('-lagg','')
git_revision = os.popen("git rev-list --max-count=1 HEAD").read()
configuration = {
"prefix": config_env['PREFIX'],
"mapnik_libname": 'mapnik2',
@ -83,6 +87,7 @@ configuration = {
"fonts": config_env['MAPNIK_FONTS'],
"input_plugins": config_env['MAPNIK_INPUT_PLUGINS'],
"svn_revision": config_env['SVN_REVISION'],
"git_revision": git_revision,
"version": config_env['MAPNIK_VERSION_STRING'],
}

View file

@ -19,7 +19,8 @@ Known values for OPTION are:
--json print all config options as json object
--help display this help and exit
-v --version output version information
--svn-revision output svn revision information
--git-revision output git hash
--svn-revision output svn revision information (deprecated)
EOF
exit $1
@ -59,6 +60,10 @@ while test $# -gt 0; do
echo $CONFIG_JSON
;;
--git-revision)
echo ${CONFIG_GIT_REVISION}
;;
--svn-revision)
echo ${CONFIG_SVN_REVISION}
;;