]> git.ipfire.org Git - thirdparty/iw.git/blame_incremental - version.sh
add remain-on-channel
[thirdparty/iw.git] / version.sh
... / ...
CommitLineData
1#!/bin/sh
2
3VERSION="0.9.22"
4OUT="$1"
5
6echo '#include "iw.h"' > "$OUT"
7
8if 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
20else
21 v="$VERSION"
22fi
23
24echo "const char iw_version[] = \"$v\";" >> "$OUT"