summaryrefslogtreecommitdiff
path: root/mk/subst.mk
diff options
context:
space:
mode:
authorgrant <grant@pkgsrc.org>2003-12-27 03:02:11 +0000
committergrant <grant@pkgsrc.org>2003-12-27 03:02:11 +0000
commit74f8aaa8f91bbdf4a7937c8d689e9e02ab3b737b (patch)
treec359dcf8f748864282bacd2d3ca3f9f375add610 /mk/subst.mk
parent751aad29d38a00dca79a92ed54ed7b8f93b9e277 (diff)
downloadpkgsrc-74f8aaa8f91bbdf4a7937c8d689e9e02ab3b737b.tar.gz
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.
Diffstat (limited to 'mk/subst.mk')
-rw-r--r--mk/subst.mk30
1 files changed, 12 insertions, 18 deletions
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