summaryrefslogtreecommitdiff
path: root/mkgitver
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2022-10-16 11:14:15 -0700
committerWayne Davison <wayne@opencoder.net>2022-10-16 11:14:15 -0700
commit677aa0dc911a452399e35e2c2b5bd18b25f5b55a (patch)
tree95d216eee4dab51806876daa4dc0e952c94bcf29 /mkgitver
parent025596757ccd21226b3306b11cc7c8d94b6f7a6f (diff)
downloadrsync-677aa0dc911a452399e35e2c2b5bd18b25f5b55a.tar.gz
Fix version verification when "\|" doesn't work in sed.
Diffstat (limited to 'mkgitver')
-rwxr-xr-xmkgitver6
1 files changed, 4 insertions, 2 deletions
diff --git a/mkgitver b/mkgitver
index 75c9fe1e..0102b089 100755
--- a/mkgitver
+++ b/mkgitver
@@ -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"