summaryrefslogtreecommitdiff
path: root/mk/subst.mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2018-01-02 21:18:48 +0000
committerrillig <rillig@pkgsrc.org>2018-01-02 21:18:48 +0000
commitc31cf3ba8abba64cf8201ba7c4dd49534de33f74 (patch)
tree1f002add183e0bc6d768d122fc2a1f970ca74148 /mk/subst.mk
parent0d3333a2ac6155dc1054f8b34c9ad51cb6493409 (diff)
downloadpkgsrc-c31cf3ba8abba64cf8201ba7c4dd49534de33f74.tar.gz
Allow package developers to easily see and check the SUBST changes.
Diffstat (limited to 'mk/subst.mk')
-rw-r--r--mk/subst.mk9
1 files changed, 8 insertions, 1 deletions
diff --git a/mk/subst.mk b/mk/subst.mk
index 7309a38be3b..ba55964e44d 100644
--- a/mk/subst.mk
+++ b/mk/subst.mk
@@ -1,4 +1,4 @@
-# $NetBSD: subst.mk,v 1.55 2016/01/31 17:27:41 rillig Exp $
+# $NetBSD: subst.mk,v 1.56 2018/01/02 21:18:48 rillig Exp $
#
# This Makefile fragment implements a general text replacement facility.
# Package makefiles define a ``class'', for each of which a particular
@@ -45,6 +45,10 @@
# before any substitutions are done to it. Since that test is not
# perfect, it can be disabled by setting this variable to "yes".
#
+# SUBST_SHOW_DIFF.<class>
+# During development of a package, this can be set to "yes" to see
+# the actual changes as a unified diff.
+#
# See also:
# PLIST_SUBST
#
@@ -80,6 +84,9 @@ 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
. endfor
+. if !empty(SUBST_SHOW_DIFF.${_class_}:Uno:M[Yy][Ee][Ss])
+_SUBST_KEEP.${_class_}?= ${DIFF} -u "$$file" "$$tmpfile" || true
+. endif
_SUBST_KEEP.${_class_}?= ${DO_NADA}
SUBST_SKIP_TEXT_CHECK.${_class_}?= no