1 #! /bin/sh
3 DEFAULT_VERSION="4.0.0.git"
5 VERSION="$( git describe --tags 2> /dev/null \
6 | sed -e 's/^v//' || true )"
8 if test -z "$VERSION"; then
9 VERSION="$DEFAULT_VERSION"
10 else
11 git update-index -q --refresh || true
12 if test -n "$( git diff-index --name-only HEAD || true )"; then
13 VERSION="$VERSION-dirty"
14 fi
15 fi
17 VERSION="$( echo "$VERSION" | sed -e 's/-/./g' )"
18 if test "x`uname -s`" = "xAIX" || test "x`uname -s`" = "xSunOS" ; then
19 echo "$VERSION\c"
20 else
21 echo -n "$VERSION"
22 fi