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