3 # this script creates version.cpp containing version and other compile-time
4 # information. it expects to get the source directory as only argument.
9 test "$src" = '' && src
=.
11 date=`date --utc +%Y-%m-%d`
12 commit
=`( cd "$src"; git rev-parse HEAD 2> /dev/null; )`
13 if test "$commit" != ''; then
14 ( cd "$src"; git
diff --quiet HEAD
; ) || commit
="$commit-dirty"
18 cat > "$output-new" <<EOF
20 const char *recorderCommit = "$commit";
21 const char *recorderDate = "$date";
24 if test -e "$output" && diff -q "$output" "$output-new" > /dev
/null
2>&1; then
27 mv "$output-new" "$output"