From 74f8aaa8f91bbdf4a7937c8d689e9e02ab3b737b Mon Sep 17 00:00:00 2001 From: grant Date: Sat, 27 Dec 2003 03:02:11 +0000 Subject: remove somewhat bogus test for text files, which was dependent on the output of file(1) which reports too many false negatives (not detecting a file as a text file when it really is). package developers are aware of which files the subst operation applies to, since they need to specify the filenames, so this test is not really required. it's also not inconceivable that one would want to subst over a non-text file, which is now possible. --- mk/subst.mk | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'mk/subst.mk') diff --git a/mk/subst.mk b/mk/subst.mk index d53014eaa25..68b5b6634cb 100644 --- a/mk/subst.mk +++ b/mk/subst.mk @@ -1,4 +1,4 @@ -# $NetBSD: subst.mk,v 1.4 2003/12/11 00:05:36 grant Exp $ +# $NetBSD: subst.mk,v 1.5 2003/12/27 03:02:11 grant Exp $ # # This Makefile fragment implements a general text replacement facility # for different classes of files in ${WRKSRC}. For each class of files, @@ -26,10 +26,6 @@ ECHO_SUBST_MSG?= ${ECHO} -# _SUBST_IS_TEXT_FILE returns 0 if $${file} is a text file. -_SUBST_IS_TEXT_FILE?= \ - ${FILE_CMD} $${file} | ${EGREP} "(shell script|text)" >/dev/null 2>&1 - .for _class_ in ${SUBST_CLASSES} _SUBST_COOKIE.${_class_}= ${WRKDIR}/.subst_${_class_}_done @@ -73,19 +69,17 @@ ${_SUBST_COOKIE.${_class_}}: case "$$files" in \ "") ;; \ *) for file in $${files}; do \ - if ${_SUBST_IS_TEXT_FILE}; then \ - ${MV} -f $$file $$file.subst.sav; \ - ${CAT} $$file.subst.sav \ - | ${SUBST_FILTER_CMD.${_class_}} \ - > $$file; \ - if [ -x $$file.subst.sav ]; then \ - ${CHMOD} +x $$file; \ - fi; \ - if ${CMP} -s $$file.subst.sav $$file; then \ - ${MV} -f $$file.subst.sav $$file; \ - else \ - ${ECHO} $$file >> ${.TARGET}; \ - fi; \ + ${MV} -f $$file $$file.subst.sav; \ + ${CAT} $$file.subst.sav \ + | ${SUBST_FILTER_CMD.${_class_}} \ + > $$file; \ + if [ -x $$file.subst.sav ]; then \ + ${CHMOD} +x $$file; \ + fi; \ + if ${CMP} -s $$file.subst.sav $$file; then \ + ${MV} -f $$file.subst.sav $$file; \ + else \ + ${ECHO} $$file >> ${.TARGET}; \ fi; \ done ;; \ esac -- cgit v1.2.3