[Asterisk-code-review] build_tools/make_version: Fix sed(1) syntax compatibility with NetBSD (asterisk[18])

Sean Bright asteriskteam at digium.com
Tue Jan 18 11:41:02 CST 2022


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/17878 )


Change subject: build_tools/make_version: Fix sed(1) syntax compatibility with NetBSD
......................................................................

build_tools/make_version: Fix sed(1) syntax compatibility with NetBSD

Fix the sed(1) invocation used to process git-svn-id not to use "\s"
that is a GNU-ism and is not supported by NetBSD sed.  As a result,
this call did not work properly and make_version did output the full
git-svn-id line rather than the revision.

ASTERISK-29852

Change-Id: Ie4b406e2748920643446851a0a252a4ca7245772
---
M build_tools/make_version
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/78/17878/1

diff --git a/build_tools/make_version b/build_tools/make_version
index ad9fb3f..83c42d1 100755
--- a/build_tools/make_version
+++ b/build_tools/make_version
@@ -98,7 +98,7 @@
     # If the first log commit messages indicates that this is checked into
     # subversion, we'll just use the SVN- form of the revision.
     MODIFIED=""
-    SVN_REV=`${GIT} log --pretty=full -1 | ${GREP} -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
+    SVN_REV=`${GIT} log --pretty=full -1 | sed -n '/git-svn-id:/ s/.*\@\([^ ]*\) .*/\1/p'`
     if [ -z "$SVN_REV" ]; then
         MAINLINE_BRANCH=$(git config -f .gitreview --get gerrit.defaultbranch)
         VERSION=`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17878
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ie4b406e2748920643446851a0a252a4ca7245772
Gerrit-Change-Number: 17878
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-CC: Michał Górny <mgorny at NetBSD.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220118/40ba475c/attachment.html>


More information about the asterisk-code-review mailing list