ab61cff7 |
1 | #!/bin/sh |
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/'` |
11 | test -n "$build" || build=0 |
12 | |
13 | trap "rm -f $2" ERR |
ab61cff7 |
14 | |
15 | sed 's/@major@/'$major'/' "$1" > "$2" |
16 | sed -i 's/@minor@/'$minor'/' "$2" |
68af34fe |
17 | sed -i 's/@build@/'$build'/' "$2" |