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.

Reviewed By:	imp
Differential Revision: https://reviews.freebsd.org/D26036
This commit is contained in:
Alex Richardson 2020-08-12 15:49:10 +00:00
parent 188d6f4bc6
commit cad2917baf

View File

@ -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