summaryrefslogtreecommitdiff
path: root/mk/subst.mk
diff options
context:
space:
mode:
authorrillig <rillig>2007-03-07 21:27:59 +0000
committerrillig <rillig>2007-03-07 21:27:59 +0000
commitc4834c2d3384b6b8de875365eb80a93ef5f53b91 (patch)
treed373526ed5dad3871507afabf14a44f6baa70022 /mk/subst.mk
parentbaa8f1ad0e23104a5539b5744d628b31ccc00077 (diff)
downloadpkgsrc-c4834c2d3384b6b8de875365eb80a93ef5f53b91.tar.gz
Fixed the quoting for SUBST_VARS.*. Now every character gets replaced
properly. The regression test passes.
Diffstat (limited to 'mk/subst.mk')
-rw-r--r--mk/subst.mk7
1 files changed, 5 insertions, 2 deletions
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