From c4834c2d3384b6b8de875365eb80a93ef5f53b91 Mon Sep 17 00:00:00 2001 From: rillig Date: Wed, 7 Mar 2007 21:27:59 +0000 Subject: Fixed the quoting for SUBST_VARS.*. Now every character gets replaced properly. The regression test passes. --- mk/subst.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mk/subst.mk') diff --git a/mk/subst.mk b/mk/subst.mk index d9d61094303..24c06e99a6c 100644 --- a/mk/subst.mk +++ b/mk/subst.mk @@ -1,4 +1,4 @@ -# $NetBSD: subst.mk,v 1.43 2007/02/05 08:39:23 rillig Exp $ +# $NetBSD: subst.mk,v 1.44 2007/03/07 21:27:59 rillig Exp $ # # This Makefile fragment implements a general text replacement facility. # Package makefiles define a ``class'', for each of which a particular @@ -63,8 +63,11 @@ _SUBST_BACKUP_SUFFIX= .subst.sav .for _class_ in ${SUBST_CLASSES} _SUBST_COOKIE.${_class_}= ${WRKDIR}/.subst_${_class_}_done +SUBST_FILTER_CMD.${_class_}?= ${SED} ${SUBST_SED.${_class_}} SUBST_VARS.${_class_}?= # none -SUBST_FILTER_CMD.${_class_}?= ${SED} ${SUBST_SED.${_class_}} ${SUBST_VARS.${_class_}:@v@-e 's,\@${v}\@,'${${v}:Q}',g' @} +. for v in ${SUBST_VARS.${_class_}} +SUBST_FILTER_CMD.${_class_} += -e s,@${v}@,${${v}:S|\\|\\\\|gW:S|,|\\,|gW:S|&|\\\&|gW:Q},g +. endfor SUBST_POSTCMD.${_class_}?= ${RM} -f "$$tmpfile" SUBST_SKIP_TEXT_CHECK.${_class_}?= no -- cgit v1.2.3