summaryrefslogtreecommitdiff
path: root/mk/subst.mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-04-01 15:10:09 +0000
committerrillig <rillig@pkgsrc.org>2020-04-01 15:10:09 +0000
commitb1feb3453d9e4d2e1983329d3832bb451003a5aa (patch)
treedc812fd00bd5f788a2e8803c62a3af46d7c7dd14 /mk/subst.mk
parenta6106c696d0491cf0a7e935c712570b28ea8ea1f (diff)
downloadpkgsrc-b1feb3453d9e4d2e1983329d3832bb451003a5aa.tar.gz
mk/subst.mk: add user-settable SUBST_NOOP_OK
This variable allows to make SUBST stricter than before. This will break several packages that have redundant filename patterns. Most of these are typos or outdated and should be updated or removed.
Diffstat (limited to 'mk/subst.mk')
-rw-r--r--mk/subst.mk16
1 files changed, 13 insertions, 3 deletions
diff --git a/mk/subst.mk b/mk/subst.mk
index 5f31b544d5d..9549932e766 100644
--- a/mk/subst.mk
+++ b/mk/subst.mk
@@ -1,4 +1,4 @@
-# $NetBSD: subst.mk,v 1.73 2020/03/28 20:39:50 rillig Exp $
+# $NetBSD: subst.mk,v 1.74 2020/04/01 15:10:09 rillig Exp $
#
# The subst framework replaces text in one or more files in the WRKSRC
# directory. Packages can define several ``classes'' of replacements.
@@ -21,6 +21,13 @@
# Whether to log each changed file as a unified diff, for all
# SUBST classes. Defaults to "no".
#
+# SUBST_NOOP_OK
+# Whether it is ok to have filename patterns in SUBST_FILES that
+# don't have any effect.
+#
+# For backwards compatibility this defaults to "yes", but it
+# should rather be set to "no".
+#
# Package-settable variables:
#
# SUBST_CLASSES
@@ -86,9 +93,12 @@
# Keywords: subst
#
+SUBST_SHOW_DIFF?= no
+SUBST_NOOP_OK?= yes # only for backwards compatiblity
+
_VARGROUPS+= subst
+_USR_VARS.subst= SUBST_SHOW_DIFF SUBST_NOOP_OK
_PKG_VARS.subst= SUBST_CLASSES
-SUBST_SHOW_DIFF?= no
.for c in ${SUBST_CLASSES}
. for pv in SUBST_STAGE SUBST_MESSAGE SUBST_FILES SUBST_SED SUBST_VARS \
SUBST_FILTER_CMD SUBST_SKIP_TEXT_CHECK SUBST_NOOP_OK
@@ -125,7 +135,7 @@ _SUBST_KEEP.${_class_}?= LC_ALL=C ${DIFF} -u "$$file" "$$tmpfile" || true
. endif
_SUBST_KEEP.${_class_}?= ${DO_NADA}
SUBST_SKIP_TEXT_CHECK.${_class_}?= no
-SUBST_NOOP_OK.${_class_}?= yes # TODO: change to no after 2020Q1
+SUBST_NOOP_OK.${_class_}?= ${SUBST_NOOP_OK}
_SUBST_WARN.${_class_}= ${${SUBST_NOOP_OK.${_class_}:tl} == yes:?${INFO_MSG}:${WARNING_MSG}} "[subst.mk:${_class_}]"
.if !empty(SUBST_SKIP_TEXT_CHECK.${_class_}:M[Yy][Ee][Ss])