Remember recording start time and use QDateTime instead of time_t
[skype-call-recorder.git] / makeversion
bloba4b536d01b1ff472209cbd967ba1e045e3ff1f79
1 #!/bin/sh
3 # this script creates version.cpp containing version and other compile-time
4 # information. it expects to get the source directory as only argument.
6 output=version.cpp
8 src=$1
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"
15 else
16 commit=unknown
18 cat > "$output-new" <<EOF
19 #include "common.h"
20 const char *recorderCommit = "$commit";
21 const char *recorderDate = "$date";
22 EOF
24 if test -e "$output" && diff -q "$output" "$output-new" > /dev/null 2>&1; then
25 rm "$output-new"
26 else
27 mv "$output-new" "$output"