pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Since there are many cases where the string @FOO@ i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/dae8738910ae
branches:  trunk
changeset: 524299:dae8738910ae
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Jan 23 06:05:39 2007 +0000

description:
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:

 mk/subst.mk |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 758d67ff2523 -r dae8738910ae mk/subst.mk
--- a/mk/subst.mk       Tue Jan 23 03:27:19 2007 +0000
+++ b/mk/subst.mk       Tue Jan 23 06:05:39 2007 +0000
@@ -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 @@
 .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
 



Home | Main Index | Thread Index | Old Index