pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk remove somewhat bogus test for text files, which wa...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8e68b47b2366
branches:  trunk
changeset: 465298:8e68b47b2366
user:      grant <grant%pkgsrc.org@localhost>
date:      Sat Dec 27 03:02:11 2003 +0000

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

 mk/subst.mk |  30 ++++++++++++------------------
 1 files changed, 12 insertions(+), 18 deletions(-)

diffs (51 lines):

diff -r dae7a350bada -r 8e68b47b2366 mk/subst.mk
--- a/mk/subst.mk       Sat Dec 27 01:02:49 2003 +0000
+++ b/mk/subst.mk       Sat Dec 27 03:02:11 2003 +0000
@@ -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 @@
        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



Home | Main Index | Thread Index | Old Index