0bc89554 |
1 | #!/bin/bash |
68af34fe |
2 | set -e |
ab61cff7 |
3 | |
68af34fe |
4 | verfile=../common/version.h |
5 | test -f $verfile |
6 | |
7 | major=`head -n 1 $verfile | sed 's/.*"\([0-9]*\)\.\([0-9]*\).*/\1/g'` |
8 | minor=`head -n 1 $verfile | sed 's/.*"\([0-9]*\)\.\([0-9]*\).*/\2/g'` |
9 | # lame, I know.. |
10 | build=`git describe HEAD | grep -- - | sed -e 's/.*\-\(.*\)\-.*/\1/'` |
ee5d41a1 |
11 | test -n "$build" && build_post="-$build" |
68af34fe |
12 | test -n "$build" || build=0 |
13 | |
14 | trap "rm -f $2" ERR |
ab61cff7 |
15 | |
ee5d41a1 |
16 | sed -e 's/@major@/'$major'/' \ |
17 | -e 's/@minor@/'$minor'/' \ |
18 | -e 's/@build@/'$build'/' \ |
19 | -e 's/@build_post@/'$build_post'/' \ |
20 | "$1" > "$2" |