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