mhl and mhbuild ignore to long lines
[mmh] / version.sh
1 #!/bin/sh
2 #
3 # version.sh -- script to create version string(s) for mmh.
4 #
5 # You can pass the top soucre directory to the script.
6 #
7
8 if [ -d "$1" ]
9 then
10         cd "$1"
11 fi
12
13 if [ ! -f VERSION ]
14 then
15         echo "No version file found" 1>&2
16         echo "usage: $0 [mmh-sourcedir]" 1>&2
17         exit 1
18 fi
19
20 version="`sed q VERSION`"
21
22 git_info=""
23
24 if [ -d ".git" ]; then
25         current=`git log -n 1 --pretty=format:+%h HEAD`
26         release=`git log -n 1 --pretty=format:+%h "mmh-$version"`
27         if [ "$current" != "$release" ]
28         then
29                 git_info="$current"
30         fi
31 fi
32
33 echo mmh-"$version""$git_info"