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