2010-05-17 18:36:48 -04:00
|
|
|
#!/bin/sh
|
2010-05-20 06:33:33 -04:00
|
|
|
GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1`
|
|
|
|
GIT_DIRTY=`git diff 2> /dev/null | wc -l`
|
2012-11-29 08:20:08 -05:00
|
|
|
BUILD_ID=`uname -n`"-"`date +%s`
|
2010-05-17 18:36:48 -04:00
|
|
|
test -f release.h || touch release.h
|
|
|
|
(cat release.h | grep SHA1 | grep $GIT_SHA1) && \
|
2013-01-16 12:00:20 -05:00
|
|
|
(cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already up-to-date
|
2010-05-17 18:36:48 -04:00
|
|
|
echo "#define REDIS_GIT_SHA1 \"$GIT_SHA1\"" > release.h
|
2010-05-18 06:17:51 -04:00
|
|
|
echo "#define REDIS_GIT_DIRTY \"$GIT_DIRTY\"" >> release.h
|
2012-11-29 08:20:08 -05:00
|
|
|
echo "#define REDIS_BUILD_ID \"$BUILD_ID\"" >> release.h
|
2010-06-13 17:51:43 -04:00
|
|
|
touch release.c # Force recompile of release.c
|