build fixed when simpler shells are used to create release.h

This commit is contained in:
antirez 2010-05-18 12:17:51 +02:00
parent a42453a593
commit 274e45e365
2 changed files with 3 additions and 3 deletions

View File

@ -1,9 +1,9 @@
#!/bin/sh
GIT_SHA1=$((git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1)
GIT_SHA1=$(git show-ref --head --hash=8 2> /dev/null | head -n1)
GIT_DIRTY=$(git diff 2> /dev/null | wc -l)
test -f release.h || touch release.h
(cat release.h | grep SHA1 | grep $GIT_SHA1) && \
(cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already uptodate
echo "#define REDIS_GIT_SHA1 \"$GIT_SHA1\"" > release.h
echo "#define REDIS_GIT_DIRTY $GIT_DIRTY" >> release.h
echo "#define REDIS_GIT_DIRTY \"$GIT_DIRTY\"" >> release.h
touch redis.c # force recompile of redis.c

View File

@ -7203,7 +7203,7 @@ static sds genRedisInfoString(void) {
"role:%s\r\n"
,REDIS_VERSION,
REDIS_GIT_SHA1,
REDIS_GIT_DIRTY > 0,
strtol(REDIS_GIT_DIRTY,NULL,10) > 0,
(sizeof(long) == 8) ? "64" : "32",
aeGetApiName(),
(long) getpid(),