Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2020 15:49:11 +0000 (UTC)
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r364167 - head/stand/common
Message-ID:  <202008121549.07CFnB3s065766@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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