]> git.ipfire.org Git - thirdparty/iw.git/blame - version.sh
add some version checking and stuff
[thirdparty/iw.git] / version.sh
CommitLineData
2dc285b7 1#!/bin/bash
d711f013 2
866c29eb 3VERSION="0.9"
7e10ba7c 4
d711f013
JB
5(
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...
12 [ "${descr/-*/}" == "v$VERSION" ] || exit 2
13
14 echo -n '#define IW_VERSION "'
15 echo -n "${descr:1}"
d711f013 16 if git diff-index --name-only HEAD | read dummy ; then
2dc285b7 17 echo -n "-dirty"
d711f013
JB
18 fi
19 echo '"'
20else
2dc285b7 21echo "#define IW_VERSION \"$VERSION\""
d711f013
JB
22fi
23) > version.h