Export openconnect_version as a pointer rather than an array
[platform/upstream/openconnect.git] / version.sh
1 #!/bin/sh
2
3 v="v3.18"
4
5 if [ -d .git ] && tag=`git describe --tags`; then
6         v="$tag"
7
8         # Update the index from working tree first
9         git update-index --refresh --unmerged > /dev/null
10
11         # Does the index show uncommitted changes?
12         git diff-index --exit-code HEAD > /dev/null || \
13                 v="$v"-dirty
14 else
15         v="$v"-unknown
16 fi
17
18 echo "const char *openconnect_version_str = \"$v\";" > $1
19 echo "New version: $v"