Thu Jun 11 20:13:22 2020 UTC ()
mk/subst.mk: remove unnecessary SUBST_VARS definition

This is a package-settable variable, and if a package leaves it
undefined, "bmake show-all-subst" should show exactly this.


(rillig)
diff -r1.98 -r1.99 pkgsrc/mk/subst.mk

cvs diff -r1.98 -r1.99 pkgsrc/mk/subst.mk (expand / switch to unified diff)

--- pkgsrc/mk/subst.mk 2020/06/11 19:38:40 1.98
+++ pkgsrc/mk/subst.mk 2020/06/11 20:13:22 1.99
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: subst.mk,v 1.98 2020/06/11 19:38:40 rillig Exp $ 1# $NetBSD: subst.mk,v 1.99 2020/06/11 20:13:22 rillig Exp $
2# 2#
3# The subst framework replaces text in one or more files in the WRKSRC 3# The subst framework replaces text in one or more files in the WRKSRC
4# directory. Packages can define several ``classes'' of replacements. 4# directory. Packages can define several ``classes'' of replacements.
5# Each such class defines: 5# Each such class defines:
6# 6#
7# - in which stage of the build process the replacement happens 7# - in which stage of the build process the replacement happens
8# - which files are affected by the replacement 8# - which files are affected by the replacement
9# - which text or pattern is replaced by which replacement text 9# - which text or pattern is replaced by which replacement text
10# 10#
11# A typical example is: 11# A typical example is:
12# 12#
13# SUBST_CLASSES+= prefix 13# SUBST_CLASSES+= prefix
14# SUBST_STAGE.prefix= pre-configure 14# SUBST_STAGE.prefix= pre-configure
@@ -135,27 +135,26 @@ _SUBST_IS_TEXT_FILE_CMD= \ @@ -135,27 +135,26 @@ _SUBST_IS_TEXT_FILE_CMD= \
135 135
136.if ${SUBST_CLASSES:U:O} != ${SUBST_CLASSES:U:O:u} 136.if ${SUBST_CLASSES:U:O} != ${SUBST_CLASSES:U:O:u}
137PKG_FAIL_REASON+= "[subst.mk] duplicate SUBST class in: ${SUBST_CLASSES:O}" 137PKG_FAIL_REASON+= "[subst.mk] duplicate SUBST class in: ${SUBST_CLASSES:O}"
138.endif 138.endif
139 139
140.for class in ${SUBST_CLASSES:O:u} 140.for class in ${SUBST_CLASSES:O:u}
141_SUBST_COOKIE.${class}= ${WRKDIR}/.subst_${class}_done 141_SUBST_COOKIE.${class}= ${WRKDIR}/.subst_${class}_done
142 142
143.if defined(SUBST_FILTER_CMD.${class}) && (defined(SUBST_SED.${class}) || defined(SUBST_VARS.${class})) 143.if defined(SUBST_FILTER_CMD.${class}) && (defined(SUBST_SED.${class}) || defined(SUBST_VARS.${class}))
144PKG_FAIL_REASON+= "[subst.mk:${class}] SUBST_FILTER_CMD and SUBST_SED/SUBST_VARS cannot be combined." 144PKG_FAIL_REASON+= "[subst.mk:${class}] SUBST_FILTER_CMD and SUBST_SED/SUBST_VARS cannot be combined."
145.endif 145.endif
146 146
147SUBST_FILTER_CMD.${class}?= LC_ALL=C ${SED} ${SUBST_SED.${class}} 147SUBST_FILTER_CMD.${class}?= LC_ALL=C ${SED} ${SUBST_SED.${class}}
148SUBST_VARS.${class}?= # none 
149SUBST_MESSAGE.${class}?= Substituting "${class}" in ${SUBST_FILES.${class}} 148SUBST_MESSAGE.${class}?= Substituting "${class}" in ${SUBST_FILES.${class}}
150. for v in ${SUBST_VARS.${class}} 149. for v in ${SUBST_VARS.${class}}
151SUBST_FILTER_CMD.${class}+= -e s,@${v:C|[.[\\*^]|\\\\&|gW:Q}@,${${v}:S|\\|\\\\|gW:S|,|\\,|gW:S|&|\\\&|gW:S|${.newline}|\\${.newline}|gW:Q},g 150SUBST_FILTER_CMD.${class}+= -e s,@${v:C|[.[\\*^]|\\\\&|gW:Q}@,${${v}:S|\\|\\\\|gW:S|,|\\,|gW:S|&|\\\&|gW:S|${.newline}|\\${.newline}|gW:Q},g
152. endfor 151. endfor
153. if ${SUBST_SHOW_DIFF.${class}:U${SUBST_SHOW_DIFF}:tl} == yes 152. if ${SUBST_SHOW_DIFF.${class}:U${SUBST_SHOW_DIFF}:tl} == yes
154_SUBST_KEEP.${class}?= LC_ALL=C ${DIFF} -u "$$file" "$$tmpfile" || true 153_SUBST_KEEP.${class}?= LC_ALL=C ${DIFF} -u "$$file" "$$tmpfile" || true
155. endif 154. endif
156_SUBST_KEEP.${class}?= ${DO_NADA} 155_SUBST_KEEP.${class}?= ${DO_NADA}
157SUBST_SKIP_TEXT_CHECK.${class}?= \ 156SUBST_SKIP_TEXT_CHECK.${class}?= \
158 no 157 no
159SUBST_NOOP_OK.${class}?= ${SUBST_NOOP_OK} 158SUBST_NOOP_OK.${class}?= ${SUBST_NOOP_OK}
160_SUBST_WARN.${class}= ${${SUBST_NOOP_OK.${class}:tl} == yes:?${INFO_MSG}:${WARNING_MSG}} "[subst.mk:${class}]" 159_SUBST_WARN.${class}= ${${SUBST_NOOP_OK.${class}:tl} == yes:?${INFO_MSG}:${WARNING_MSG}} "[subst.mk:${class}]"
161 160