From c5e4187590f37e9524a8e3fcb2bccb20f2e8b4eb Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 18 Apr 2011 17:45:50 +0200 Subject: Add Git version string support. Introduce a script to auto-generate version strings. Use `git describe` to create descriptive version strings when building from a Git checkout, use ".version" files for release tarballs. Signed-off-by: Lukas Fleischer --- build-aux/git-version-gen | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 build-aux/git-version-gen (limited to 'build-aux') diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen new file mode 100755 index 0000000..2cc88fc --- /dev/null +++ b/build-aux/git-version-gen @@ -0,0 +1,24 @@ +#!/bin/sh + +if [ "$#" -ne 1 ] +then + echo "usage: git-version-gen " >&2 + exit 1 +fi + +VERFILE="$1" + +if [ -d '.git' ] +then + VERSION=`git describe --abbrev=4 --match='v[0-9]*' --dirty | sed 's/^v//'` + echo -n "$VERSION" > "$VERFILE" +fi + +if [ -f "$VERFILE" ] +then + cat "$VERFILE" +else + echo "git-version-gen: unknown version number." >&2 + exit 1 +fi + -- cgit v1.2.3-70-g09d2