summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3ab1996)
raw | patch | inline | side by side (parent: 3ab1996)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 26 Jul 2007 16:13:18 +0000 (18:13 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 22 Aug 2007 14:35:40 +0000 (16:35 +0200) |
This dynamically creates the version string when the configure script is
created. If run from within a repository the output of "git describe" is
used to create the version string. Else it defaults to a hardcoded value
which should be something like "$latest_version.git".
The idea is to update the default version to the new version (without
".git" appended) as the last commit of a release cycle. This commit is
tagged as the new version. The next commit after the release will set the
default version to "$new_version.git".
The benefit is that a pre-release with a quite well defined and unique
version can be easily created at any time.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
created. If run from within a repository the output of "git describe" is
used to create the version string. Else it defaults to a hardcoded value
which should be something like "$latest_version.git".
The idea is to update the default version to the new version (without
".git" appended) as the last commit of a release cycle. This commit is
tagged as the new version. The next commit after the release will set the
default version to "$new_version.git".
The benefit is that a pre-release with a quite well defined and unique
version can be easily created at any time.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
configure.in | patch | blob | history | |
version-gen.sh | [new file with mode: 0755] | patch | blob |
diff --git a/configure.in b/configure.in
index 5b3a54a6548bbe687efea5d0a4032eeb654db7b8..735ea74943acaa4d5f7eb04b7bddfab5a7d0b8ad 100644 (file)
--- a/configure.in
+++ b/configure.in
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 4.0.5)
+AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
AC_CONFIG_SRCDIR(src/collectd.c)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE(dist-bzip2)
diff --git a/version-gen.sh b/version-gen.sh
--- /dev/null
+++ b/version-gen.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+DEFAULT_VERSION="4.0.5.git"
+
+VERSION="$( git describe 2> /dev/null | sed -e 's/^collectd-//' )"
+
+if test -z "$VERSION"; then
+ VERSION="$DEFAULT_VERSION"
+fi
+
+VERSION=$( echo "$VERSION" | sed -e 's/-/./g' )
+
+echo -n $VERSION
+