summaryrefslogtreecommitdiff
path: root/get_vers.sh
blob: 7f281aeb0d68605999c68c873eb2f2d91160a37d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

top_srcdir=${1:-`pwd`}

if test -f ${top_srcdir}/VERSION; then
    VERSION=`cat ${top_srcdir}/VERSION`
elif test -d ${top_srcdir}/.git; then
    VERSION=`(cd $top_srcdir; git describe --abbrev=6 --dirty | sed -e 's/%7E/~/')`
fi

if test -z "$VERSION"; then
    VERSION='FROM SPACE'
fi

echo $VERSION