pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/flavor/pkg Replaced the pipe operator with temporar...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ee82b2beddc9
branches:  trunk
changeset: 519746:ee82b2beddc9
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Oct 09 01:40:49 2006 +0000

description:
Replaced the pipe operator with temporary files, since the former hides
errors. Now "make depends" stops on dependency directories that don't
exist.

The dependencies are first extracted into two temporary files and then
combined with cat(1) because otherwise "make depends" passes silently on
errors when it is called for the second time. Somehow ${.TARGET} didn't
get removed.

diffstat:

 mk/flavor/pkg/depends.mk |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r 65ec039db9fd -r ee82b2beddc9 mk/flavor/pkg/depends.mk
--- a/mk/flavor/pkg/depends.mk  Mon Oct 09 01:34:10 2006 +0000
+++ b/mk/flavor/pkg/depends.mk  Mon Oct 09 01:40:49 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.12 2006/07/27 21:46:46 jlam Exp $
+# $NetBSD: depends.mk,v 1.13 2006/10/09 01:40:49 rillig Exp $
 
 _DEPENDS_FILE=         ${WRKDIR}/.depends
 _REDUCE_DEPENDS_CMD=   ${SETENV} CAT=${CAT:Q}                          \
@@ -42,24 +42,26 @@
 
 ${_DEPENDS_FILE}:
        ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       ${_REDUCE_DEPENDS_CMD} ${BUILD_DEPENDS:Q} |                     \
+       ${_PKG_SILENT}${_PKG_DEBUG} set -e;                             \
+       ${_REDUCE_DEPENDS_CMD} ${BUILD_DEPENDS:Q} > ${.TARGET}.tmp;     \
        while read dep; do                                              \
                pattern=`${ECHO} $$dep | ${SED} -e "s,:.*,,"`;          \
                dir=`${ECHO} $$dep | ${SED} -e "s,.*:,,"`;              \
                ${TEST} -n "$$pattern" || exit 1;                       \
                ${TEST} -n "$$dir" || exit 1;                           \
                ${ECHO} "build  $$pattern       $$dir";                 \
-       done >> ${.TARGET}
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       ${_REDUCE_DEPENDS_CMD} ${DEPENDS:Q} |                           \
+       done < ${.TARGET}.tmp >> ${.TARGET}.tmp1
+       ${_PKG_SILENT}${_PKG_DEBUG} set -e;                             \
+       ${_REDUCE_DEPENDS_CMD} ${DEPENDS:Q} > ${.TARGET}.tmp;           \
        while read dep; do                                              \
                pattern=`${ECHO} $$dep | ${SED} -e "s,:.*,,"`;          \
                dir=`${ECHO} $$dep | ${SED} -e "s,.*:,,"`;              \
                ${TEST} -n "$$pattern" || exit 1;                       \
                ${TEST} -n "$$dir" || exit 1;                           \
                ${ECHO} "full   $$pattern       $$dir";                 \
-       done >> ${.TARGET}
+       done < ${.TARGET}.tmp >> ${.TARGET}.tmp2
+       ${_PKG_DEBUG}${_PKG_SILENT}                                     \
+       cat ${.TARGET}.tmp1 ${.TARGET.tmp2} >> ${.TARGET}
 
 ######################################################################
 ### depends-install (PRIVATE, pkgsrc/mk/depends/depends.mk)



Home | Main Index | Thread Index | Old Index