Skip to content

Commit

Permalink
build fixed when simpler shells are used to create release.h
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez authored and ngmoco:) committed Jun 4, 2010
1 parent 4bf4ae4 commit eafea48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mkreleasehdr.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -7209,7 +7209,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(),
Expand Down

0 comments on commit eafea48

Please sign in to comment.