Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2021 01:16:44 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 1b6c96c6034a - stable/12 - Fix stand/newvers.sh with zsh in sh mode
Message-ID:  <202110080116.1981GidM010932@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=1b6c96c6034a71662bf4ffcd4d79489e5526afd6

commit 1b6c96c6034a71662bf4ffcd4d79489e5526afd6
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2020-08-12 15:49:10 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-08 01:15:59 +0000

    Fix stand/newvers.sh with zsh in sh mode
    
    When building on macOS with sh==zsh, newvers.sh was producing an
    unterminated string literal due to \\n being turned as a newline. Fix this
    by using a here document instead.
    
    (cherry picked from commit cad2917baf6e8d90720f5bfb2463dfa7be35f568)
---
 stand/common/newvers.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/stand/common/newvers.sh b/stand/common/newvers.sh
index 75efeceab26b..714adba6c9cb 100755
--- a/stand/common/newvers.sh
+++ b/stand/common/newvers.sh
@@ -55,6 +55,8 @@ if [ -n "${include_metadata}" ]; then
 	bootprog_info="$bootprog_info(${t} ${u}@${h})\\n"
 fi
 
-echo "char bootprog_info[] = \"$bootprog_info\";" > $tempfile
-echo "unsigned bootprog_rev = ${r%%.*}${r##*.};" >> $tempfile
+cat > $tempfile <<EOF
+char bootprog_info[] = "$bootprog_info";
+unsigned bootprog_rev = ${r%%.*}${r##*.};
+EOF
 mv $tempfile vers.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110080116.1981GidM010932>