summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2019-03-17 12:01:14 +0000
committerrillig <rillig@pkgsrc.org>2019-03-17 12:01:14 +0000
commit10fe4508d732ade44dd90404420f0ea3758a7163 (patch)
tree2a20a83646247cba61093dbbaae167f9e41573bd /mk
parente9582a68ece2c07d6a6583a9914b37b255be097d (diff)
downloadpkgsrc-10fe4508d732ade44dd90404420f0ea3758a7163.tar.gz
mk/subst.mk: substitute embedded newlines, escape dots in variable names
Diffstat (limited to 'mk')
-rw-r--r--mk/subst.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/mk/subst.mk b/mk/subst.mk
index cb9a44b2f4e..301341b0551 100644
--- a/mk/subst.mk
+++ b/mk/subst.mk
@@ -1,4 +1,4 @@
-# $NetBSD: subst.mk,v 1.58 2018/11/30 18:38:19 rillig Exp $
+# $NetBSD: subst.mk,v 1.59 2019/03/17 12:01:14 rillig Exp $
#
# This Makefile fragment implements a general text replacement facility.
# Package makefiles define a ``class'', for each of which a particular
@@ -84,7 +84,7 @@ SUBST_FILTER_CMD.${_class_}?= ${SED} ${SUBST_SED.${_class_}}
SUBST_VARS.${_class_}?= # none
SUBST_MESSAGE.${_class_}?= Substituting "${_class_}" in ${SUBST_FILES.${_class_}}
. for v in ${SUBST_VARS.${_class_}}
-SUBST_FILTER_CMD.${_class_}+= -e s,@${v}@,${${v}:S|\\|\\\\|gW:S|,|\\,|gW:S|&|\\\&|gW:Q},g
+SUBST_FILTER_CMD.${_class_}+= -e s,@${v:C|[^A-Za-z0-9_]|\\\\&|gW:Q}@,${${v}:S|\\|\\\\|gW:S|,|\\,|gW:S|&|\\\&|gW:S|${.newline}|\\${.newline}|gW:Q},g
. endfor
. if !empty(SUBST_SHOW_DIFF.${_class_}:Uno:M[Yy][Ee][Ss])
_SUBST_KEEP.${_class_}?= ${DIFF} -u "$$file" "$$tmpfile" || true