summaryrefslogtreecommitdiff
path: root/mk/subst.mk
diff options
context:
space:
mode:
authorgrant <grant>2003-12-27 03:02:11 +0000
committergrant <grant>2003-12-27 03:02:11 +0000
commit693e1d397f058abfc5ec72b9f4ec69b1a4093c2a (patch)
treec359dcf8f748864282bacd2d3ca3f9f375add610 /mk/subst.mk
parent8c58205b63951ac337f42fcd2c89b4d1a91ecdaf (diff)
downloadpkgsrc-693e1d397f058abfc5ec72b9f4ec69b1a4093c2a.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