From 5a0a1754339f313834f2eb581a8a3a65a8e5ba65 Mon Sep 17 00:00:00 2001 From: rillig Date: Fri, 1 May 2020 06:42:32 +0000 Subject: mk/subst.mk: switch command substitution back to backticks To work properly, the $(...) should have been $$(...). In pkgsrc the command substitution is usually done via `backticks`, for compatibility with /bin/sh from Solaris. To fix the shell parse errors, the special characters are properly escaped inside the command substitution. --- mk/subst.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mk/subst.mk') diff --git a/mk/subst.mk b/mk/subst.mk index 403c9416c9e..c5d62eaa901 100644 --- a/mk/subst.mk +++ b/mk/subst.mk @@ -1,4 +1,4 @@ -# $NetBSD: subst.mk,v 1.89 2020/04/30 23:52:30 joerg Exp $ +# $NetBSD: subst.mk,v 1.90 2020/05/01 06:42:32 rillig Exp $ # # The subst framework replaces text in one or more files in the WRKSRC # directory. Packages can define several ``classes'' of replacements. @@ -200,7 +200,7 @@ ${_SUBST_COOKIE.${class}}: ${SUBST_FILTER_CMD.${class}} < "$$file" > "$$tmpfile"; \ ${CMP} -s "$$tmpfile" "$$file" && { \ ${AWK} -f ${PKGSRCDIR}/mk/scripts/subst-identity.awk -- ${SUBST_SED.${class}} \ - && found=$(LC_ALL=C ${SED} -n ${SUBST_SED.${class}:C,^['"]?s.*,&p,} "$$file") \ + && found=`LC_ALL=C ${SED} -n ${SUBST_SED.${class}:C,^['"]?s.*,&p,:C,[\\`"],\\\\&,g} "$$file"` \ && [ -n "$$found" ] && { \ changed=yes; \ continue; \ -- cgit v1.2.3