diff options
author | rillig <rillig@pkgsrc.org> | 2007-01-23 06:05:39 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-01-23 06:05:39 +0000 |
commit | a1fe379914fcb7c79d261c6a7c006ab0351d1cc9 (patch) | |
tree | e8cc8e3afe2a871a9e7cb220fe4d5f9a4f666cb5 /mk/subst.mk | |
parent | 311702115f1dfdb2331ed461276c6f92c93c9bb7 (diff) | |
download | pkgsrc-a1fe379914fcb7c79d261c6a7c006ab0351d1cc9.tar.gz |
Since there are many cases where the string @FOO@ is replaced with the
pkgsrc variable ${FOO}, there is now a shorter variant for it. Instead
of defining SUBST_SED.*, just say SUBST_VARS.* = FOO.
Diffstat (limited to 'mk/subst.mk')
-rw-r--r-- | mk/subst.mk | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/mk/subst.mk b/mk/subst.mk index 048dbef9208..460d4054c5d 100644 --- a/mk/subst.mk +++ b/mk/subst.mk @@ -1,4 +1,4 @@ -# $NetBSD: subst.mk,v 1.41 2007/01/14 17:05:02 rillig Exp $ +# $NetBSD: subst.mk,v 1.42 2007/01/23 06:05:39 rillig Exp $ # # This Makefile fragment implements a general text replacement facility. # Package makefiles define a ``class'', for each of which a particular @@ -25,6 +25,14 @@ # List of sed(1) arguments to run on the specified files. Multiple # commands can be specified using the -e option of sed. # +# SUBST_VARS.<class> +# List of variables that are substituted whenever they appear in +# the form @VARNAME@. This is basically a short-cut for +# +# -e 's,@VARNAME@,${VARNAME},g' +# +# also taking care of (most) quoting issues. +# # SUBST_FILTER_CMD.<class> # Filter used to perform the actual substitution on the specified # files. Defaults to ${SED} ${SUBST_SED.<class>}. @@ -55,7 +63,8 @@ _SUBST_BACKUP_SUFFIX= .subst.sav .for _class_ in ${SUBST_CLASSES} _SUBST_COOKIE.${_class_}= ${WRKDIR}/.subst_${_class_}_done -SUBST_FILTER_CMD.${_class_}?= ${SED} ${SUBST_SED.${_class_}} +SUBST_VARS.${_class_}?= # none +SUBST_FILTER_CMD.${_class_}?= ${SED} ${SUBST_SED.${_class_}} ${SUBST_VARS.${_class_}:@v@-e 's,\@${v}\@,'${${v}:Q}',g' @} SUBST_POSTCMD.${_class_}?= ${RM} -f "$$tmpfile" SUBST_SKIP_TEXT_CHECK.${_class_}?= no |