diff options
author | jlam <jlam@pkgsrc.org> | 2004-08-23 16:35:11 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-08-23 16:35:11 +0000 |
commit | 12887cdd6a27d42e39a299763c21ef29305a30de (patch) | |
tree | d9b0b108ac1795454520f01930b965cbac73e332 /mk/subst.mk | |
parent | b1274e16a5139e344535c63eaaf857cb8bb8c9b3 (diff) | |
download | pkgsrc-12887cdd6a27d42e39a299763c21ef29305a30de.tar.gz |
Use _SUBST_BACKUP_SUFFIX instead of hardcoding ".subst.sav" everywhere.
Diffstat (limited to 'mk/subst.mk')
-rw-r--r-- | mk/subst.mk | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/mk/subst.mk b/mk/subst.mk index 605e97c7dc6..d5f0bc72b7a 100644 --- a/mk/subst.mk +++ b/mk/subst.mk @@ -1,4 +1,4 @@ -# $NetBSD: subst.mk,v 1.13 2004/08/23 09:01:57 jlam Exp $ +# $NetBSD: subst.mk,v 1.14 2004/08/23 16:35:11 jlam Exp $ # # This Makefile fragment implements a general text replacement facility. # Package makefiles define a ``class'', for each of which a paricular @@ -30,7 +30,7 @@ # # SUBST_POSTCMD.<class> # command to clean up after sed(1). Defaults to ${RM} -f -# $$file.subst.sav. For debugging, set it to ${DO_NADA}. +# $$file${_SUBST_BACKUP_SUFFIX}. For debugging, set it to ${DO_NADA}. ECHO_SUBST_MSG?= ${ECHO} @@ -38,12 +38,14 @@ ECHO_SUBST_MSG?= ${ECHO} _SUBST_IS_TEXT_FILE?= \ ${FILE_CMD} $${file} | ${EGREP} "(executable .* script|shell script|text)" >/dev/null 2>&1 +_SUBST_BACKUP_SUFFIX= .subst.sav + .for _class_ in ${SUBST_CLASSES} _SUBST_COOKIE.${_class_}= ${WRKDIR}/.subst_${_class_}_done . if defined(SUBST_SED.${_class_}) && !empty(SUBST_SED.${_class_}) SUBST_FILTER_CMD.${_class_}?= ${SED} ${SUBST_SED.${_class_}} -SUBST_POSTCMD.${_class_}?= ${RM} -f $$file.subst.sav +SUBST_POSTCMD.${_class_}?= ${RM} -f $$file${_SUBST_BACKUP_SUFFIX} . else SUBST_FILTER_CMD.${_class_}?= ${CAT} . endif @@ -83,15 +85,15 @@ ${_SUBST_COOKIE.${_class_}}: "") ;; \ *) for file in $${files}; do \ if ${_SUBST_IS_TEXT_FILE}; then \ - ${MV} -f $$file $$file.subst.sav || exit 1; \ - ${CAT} $$file.subst.sav \ + ${MV} -f $$file $$file${_SUBST_BACKUP_SUFFIX} || exit 1; \ + ${CAT} $$file${_SUBST_BACKUP_SUFFIX} \ | ${SUBST_FILTER_CMD.${_class_}} \ > $$file; \ - if [ -x $$file.subst.sav ]; then \ + if [ -x $$file${_SUBST_BACKUP_SUFFIX} ]; then \ ${CHMOD} +x $$file; \ fi; \ - if ${CMP} -s $$file.subst.sav $$file; then \ - ${MV} -f $$file.subst.sav $$file; \ + if ${CMP} -s $$file${_SUBST_BACKUP_SUFFIX} $$file; then \ + ${MV} -f $$file${_SUBST_BACKUP_SUFFIX} $$file; \ else \ ${SUBST_POSTCMD.${_class_}}; \ ${ECHO} $$file >> ${.TARGET}; \ |