X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/274e45e365a484ba0b3a957ead8c420484d6fca9..7fc98533392f455974d546c88bd4d41c85e6fe6d:/mkreleasehdr.sh?ds=sidebyside diff --git a/mkreleasehdr.sh b/mkreleasehdr.sh index ea3b35a5..45f5173a 100755 --- a/mkreleasehdr.sh +++ b/mkreleasehdr.sh @@ -1,9 +1,9 @@ #!/bin/sh -GIT_SHA1=$(git show-ref --head --hash=8 2> /dev/null | head -n1) -GIT_DIRTY=$(git diff 2> /dev/null | wc -l) +GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | 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 -touch redis.c # force recompile of redis.c +touch redis.c # Force recompile of redis.c