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