]> git.ipfire.org Git - thirdparty/iw.git/blob - version.sh
version 0.9.18
[thirdparty/iw.git] / version.sh
1 #!/bin/sh
2
3 VERSION="0.9.18"
4 OUT="$1"
5
6 echo '#include "iw.h"' > "$OUT"
7
8 if head=`git rev-parse --verify HEAD 2>/dev/null`; then
9 git update-index --refresh --unmerged > /dev/null
10 descr=$(git describe)
11
12 # on git builds check that the version number above
13 # is correct...
14 [ "${descr%%-*}" = "v$VERSION" ] || exit 2
15
16 v="${descr#v}"
17 if git diff-index --name-only HEAD | read dummy ; then
18 v="$v"-dirty
19 fi
20 else
21 v="$VERSION"
22 fi
23
24 echo "const char iw_version[] = \"$v\";" >> "$OUT"