diff options
author | Wayne Davison <wayne@opencoder.net> | 2022-10-16 11:14:15 -0700 |
---|---|---|
committer | Wayne Davison <wayne@opencoder.net> | 2022-10-16 11:14:15 -0700 |
commit | 677aa0dc911a452399e35e2c2b5bd18b25f5b55a (patch) | |
tree | 95d216eee4dab51806876daa4dc0e952c94bcf29 /mkgitver | |
parent | 025596757ccd21226b3306b11cc7c8d94b6f7a6f (diff) | |
download | rsync-677aa0dc911a452399e35e2c2b5bd18b25f5b55a.tar.gz |
Fix version verification when "\|" doesn't work in sed.
Diffstat (limited to 'mkgitver')
-rwxr-xr-x | mkgitver | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -7,8 +7,10 @@ if [ ! -f git-version.h ]; then fi if test -d "$srcdir/.git" || test -f "$srcdir/.git"; then - gitver=`git describe --abbrev=8 2>/dev/null | sed -n '/^v3\.[0-9][0-9]*\.[0-9][0-9]*\(pre[0-9]*\)*\(-\|$\)/p'` - if [ -n "$gitver" ]; then + gitver=`git describe --abbrev=8 2>/dev/null` + # NOTE: I'm avoiding "|" in sed since I'm not sure if sed -r is portable and "\|" fails on some OSes. + verchk=`echo "$gitver-" | sed -n '/^v3\.[0-9][0-9]*\.[0-9][0-9]*\(pre[0-9]*\)*-/p'` + if [ -n "$verchk" ]; then echo "#define RSYNC_GITVER \"$gitver\"" >git-version.h.new if ! diff git-version.h.new git-version.h >/dev/null; then echo "Updating git-version.h" |