From c31cf3ba8abba64cf8201ba7c4dd49534de33f74 Mon Sep 17 00:00:00 2001 From: rillig Date: Tue, 2 Jan 2018 21:18:48 +0000 Subject: Allow package developers to easily see and check the SUBST changes. --- mk/subst.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mk/subst.mk') 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. +# 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 -- cgit v1.2.3