git: 1b6c96c6034a - stable/12 - Fix stand/newvers.sh with zsh in sh mode
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 08 Oct 2021 01:16:44 UTC
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