diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rwxr-xr-x | version | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 3bc327c..05bafa7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([sugar-runner], [0.1], [dwnarvaez@gmail.com]) +AC_INIT([sugar-runner], m4_esyscmd([./version]), [dwnarvaez@gmail.com]) AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_MACRO_DIR([m4]) @@ -0,0 +1,12 @@ +#!/usr/bin/python + +import re +import subprocess +import sys + +description = subprocess.check_output(["git", "describe"]) +match = re.match(r"v([\d\.]+)", description) +if match: + sys.stdout.write(match.groups()[0]) +else: + raise Exception("Unknown version. Please create an annotated tag.") |