diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-16 10:59:15 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-16 11:15:18 (GMT) |
commit | e95069f9c2ed0e9b8a54f253c3582ee2db1d8a15 (patch) | |
tree | 774bf128f64d2440064e767bda34dd3b6139b047 | |
parent | 1751af13fafcaaf96c94b4e834e8ece36bf0a5f9 (diff) |
Use git to figure out the version numberv0.1
-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.") |