Version 2.1.15.11.17
[clinfo] / new-version.sh
1 #!/bin/sh
2
3 # Change the version recorded in src/clinfo.c and man/clinfo.1 to
4 # the current highest OpenCL supported standard followed by current
5 # yy.mm.dd
6
7 abort() {
8         echo "$1" >&2
9         exit 1
10 }
11
12 test -n "$(git status --porcelain | grep -v '??')" && abort "Uncommited changes, aborting"
13
14 DATE=$(date +%Y-%m-%d)
15 MAJOR=$(awk '/^OpenCL/ { print $NF ; quit }' man/clinfo.1)
16 SUBV=$(date +%y.%m.%d)
17 VERSION="$MAJOR$SUBV"
18
19
20 sed -i -e "/clinfo version/ s/version \S\+\"/version $VERSION\"/" src/clinfo.c
21 sed -i -e "1 s/\".\+$/\"$DATE\" \"clinfo $VERSION\"/" man/clinfo.1
22
23 git commit -m "Version $VERSION" -e -a && git tag $VERSION
24