X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=version.sh;fp=version.sh;h=9c868de3fd9f8cd2e345fe022cf6f0208f85d3e3;hp=0000000000000000000000000000000000000000;hb=6e4f8128fe078a3e54f5c92d27c31acc7b8f9fd8;hpb=9a990c3302e6bf6c5c313541cbc1cbcea16dcb4d diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..9c868de --- /dev/null +++ b/version.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# version.sh -- script to create version string(s) for mmh. +# +# You can pass the top soucre directory to the script. +# + +if [ -d "$1" ] +then + cd "$1" +fi + +if [ ! -f VERSION ] +then + echo "No version file found" 1>&2 + echo "usage: $0 [mmh-sourcedir]" 1>&2 + exit 1 +fi + +version="`sed q VERSION`" + +git_info="" + +if [ -d ".git" ]; then + current=`git log -n 1 --pretty=format:+%h HEAD` + release=`git log -n 1 --pretty=format:+%h "mmh-$version"` + if [ "$current" != "$release" ] + then + git_info="$current" + fi +fi + +echo mmh-"$version""$git_info"