]>
Commit | Line | Data |
---|---|---|
d73c26d2 WD |
1 | #!/bin/sh |
2 | ||
3 | srcdir=`dirname $0` | |
68b1ce1d | 4 | |
bff084c1 WD |
5 | if [ ! -f git-version.h ]; then |
6 | touch git-version.h | |
7 | fi | |
8 | ||
c8c62775 | 9 | if test -d "$srcdir/.git" || test -f "$srcdir/.git"; then |
677aa0dc WD |
10 | gitver=`git describe --abbrev=8 2>/dev/null` |
11 | # NOTE: I'm avoiding "|" in sed since I'm not sure if sed -r is portable and "\|" fails on some OSes. | |
12 | verchk=`echo "$gitver-" | sed -n '/^v3\.[0-9][0-9]*\.[0-9][0-9]*\(pre[0-9]*\)*-/p'` | |
13 | if [ -n "$verchk" ]; then | |
bff084c1 WD |
14 | echo "#define RSYNC_GITVER \"$gitver\"" >git-version.h.new |
15 | if ! diff git-version.h.new git-version.h >/dev/null; then | |
16 | echo "Updating git-version.h" | |
17 | mv git-version.h.new git-version.h | |
18 | else | |
19 | rm git-version.h.new | |
20 | fi | |
2895b65f WD |
21 | fi |
22 | fi |