svn commit: r364167 - head/stand/common

Alex Richardson arichardson at FreeBSD.org
Wed Aug 12 15:49:13 UTC 2020


Author: arichardson
Date: Wed Aug 12 15:49:10 2020
New Revision: 364167
URL: https://svnweb.freebsd.org/changeset/base/364167

Log:
  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

Modified:
  head/stand/common/newvers.sh

Modified: head/stand/common/newvers.sh
==============================================================================
--- head/stand/common/newvers.sh	Wed Aug 12 15:49:06 2020	(r364166)
+++ head/stand/common/newvers.sh	Wed Aug 12 15:49:10 2020	(r364167)
@@ -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


More information about the svn-src-head mailing list