pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Revert part of revision 1.18. The new quoting was ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d5a74b981289
branches:  trunk
changeset: 494189:d5a74b981289
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri May 20 18:40:42 2005 +0000

description:
Revert part of revision 1.18.  The new quoting was breaking some
assumptions being made by the USE_PKGLOCALEDIR code and the wrapper
framework since it added backtick expressions to the SUBST_FILES.*
variables, which were being mangled by the :Q modifier.  This is
evident when running "make regress" in regress/buildlink-unwrap.

Mea culpa.

diffstat:

 mk/subst.mk |  45 +++++++++++++++++++++++----------------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diffs (65 lines):

diff -r efa4cee86e81 -r d5a74b981289 mk/subst.mk
--- a/mk/subst.mk       Fri May 20 18:12:16 2005 +0000
+++ b/mk/subst.mk       Fri May 20 18:40:42 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: subst.mk,v 1.19 2005/05/18 03:33:51 rillig Exp $
+# $NetBSD: subst.mk,v 1.20 2005/05/20 18:40:42 jlam Exp $
 #
 # This Makefile fragment implements a general text replacement facility.
 # Package makefiles define a ``class'', for each of which a paricular
@@ -47,7 +47,7 @@
 _SUBST_COOKIE.${_class_}=      ${WRKDIR}/.subst_${_class_}_done
 
 SUBST_FILTER_CMD.${_class_}?=  ${SED} ${SUBST_SED.${_class_}}
-SUBST_POSTCMD.${_class_}?=     ${RM} -f "$$tmpfile"
+SUBST_POSTCMD.${_class_}?=     ${RM} -f $$file${_SUBST_BACKUP_SUFFIX}
 
 SUBST_TARGETS+=                        subst-${_class_}
 _SUBST_TARGETS.${_class_}=     subst-${_class_}-message
@@ -77,25 +77,26 @@
 
 ${_SUBST_COOKIE.${_class_}}:
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       cd ${WRKSRC:Q};                                                 \
-       files=${SUBST_FILES.${_class_}:Q};                              \
-       for file in $$files; do                                         \
-               file="./$$file";                                        \
-               tmpfile="$$file"${_SUBST_BACKUP_SUFFIX:Q};              \
-               if ${_SUBST_IS_TEXT_FILE}; then                         \
-                       ${MV} -f "$$file" "$$tmpfile" || exit 1;        \
-                       ${CAT} "$$tmpfile"                              \
-                       | ${SUBST_FILTER_CMD.${_class_}}                \
-                       > "$$file";                                     \
-                       if ${TEST} -x "$$tmpfile"; then                 \
-                               ${CHMOD} +x "$$file";                   \
+       cd ${WRKSRC};                                                   \
+       files="${SUBST_FILES.${_class_}}";                              \
+       case "$$files" in                                               \
+       "")     ;;                                                      \
+       *)      for file in $${files}; do                               \
+                       if ${_SUBST_IS_TEXT_FILE}; then                 \
+                               ${MV} -f $$file $$file${_SUBST_BACKUP_SUFFIX} || exit 1; \
+                               ${CAT} $$file${_SUBST_BACKUP_SUFFIX}    \
+                                       | ${SUBST_FILTER_CMD.${_class_}} \
+                                       > $$file;                       \
+                               if [ -x $$file${_SUBST_BACKUP_SUFFIX} ]; then \
+                                       ${CHMOD} +x $$file;             \
+                               fi;                                     \
+                               if ${CMP} -s $$file${_SUBST_BACKUP_SUFFIX} $$file; then \
+                                       ${MV} -f $$file${_SUBST_BACKUP_SUFFIX} $$file; \
+                               else                                    \
+                                       ${SUBST_POSTCMD.${_class_}};    \
+                                       ${ECHO} $$file >> ${.TARGET};   \
+                               fi;                                     \
                        fi;                                             \
-                       if ${CMP} -s "$$tmpfile" "$$file"; then         \
-                               ${MV} -f "$$tmpfile" "$$file";          \
-                       else                                            \
-                               ${SUBST_POSTCMD.${_class_}};            \
-                               ${ECHO} "$$file" >> ${.TARGET};         \
-                       fi;                                             \
-               fi;                                                     \
-       done
+               done ;;                                                 \
+       esac
 .endfor



Home | Main Index | Thread Index | Old Index