summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-06-14 15:09:34 +0000
committerjlam <jlam@pkgsrc.org>2006-06-14 15:09:34 +0000
commit877745fd8fd8be6a9bc5523c2e12bde582efe64a (patch)
tree33507514ac55f66eaa802cb1e94211f0882ae395 /mk
parentb0505dab467c79ef680b18e9d4e9ab305c81158a (diff)
downloadpkgsrc-877745fd8fd8be6a9bc5523c2e12bde582efe64a.tar.gz
Create DELAYED_{ERROR,WARNING}_MSG macros that can be used to output
error and warning messages that are picked up by the error-check target. Use them instead of using a bare ${ECHO} for more code clarity. Implemented as suggested by Roland Illig.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.error.mk9
-rw-r--r--mk/check/check-interpreter.mk12
2 files changed, 12 insertions, 9 deletions
diff --git a/mk/bsd.pkg.error.mk b/mk/bsd.pkg.error.mk
index 4c744e5a1a1..a4d14ebdcc4 100644
--- a/mk/bsd.pkg.error.mk
+++ b/mk/bsd.pkg.error.mk
@@ -1,8 +1,15 @@
-# $NetBSD: bsd.pkg.error.mk,v 1.1 2006/06/09 13:59:06 jlam Exp $
+# $NetBSD: bsd.pkg.error.mk,v 1.2 2006/06/14 15:09:34 jlam Exp $
ERROR_DIR= ${WRKDIR}/.error
WARNING_DIR= ${WRKDIR}/.warning
+# Macros for outputting delayed error and warning messages that are
+# picked up by the error-check target and can be used in place of
+# ${ECHO}. We output to files that are named without leading dots.
+#
+DELAYED_ERROR_MSG?= ${ECHO} >> ${ERROR_DIR}/${.TARGET:T:C/^[.]*//:Q}
+DELAYED_WARNING_MSG?= ${ECHO} >> ${WARNING_DIR}/${.TARGET:T:C/^[.]*//:Q}
+
makedirs: ${ERROR_DIR} ${WARNING_DIR}
${ERROR_DIR} ${WARNING_DIR}:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET}
diff --git a/mk/check/check-interpreter.mk b/mk/check/check-interpreter.mk
index af7f8b7b0f9..fa3fc5faf59 100644
--- a/mk/check/check-interpreter.mk
+++ b/mk/check/check-interpreter.mk
@@ -1,4 +1,4 @@
-# $NetBSD: check-interpreter.mk,v 1.5 2006/06/12 03:42:02 jlam Exp $
+# $NetBSD: check-interpreter.mk,v 1.6 2006/06/14 15:09:34 jlam Exp $
CHECK_INTERPRETER?= no
@@ -27,16 +27,12 @@ check-interpreter: error-check
"in ${PKGNAME}"
.if !defined(NO_PKG_REGISTER)
${_PKG_SILENT}${_PKG_DEBUG} \
- ${RM} -f ${ERROR_DIR}/${.TARGET} ${WARNING_DIR}/${.TARGET}
- ${_PKG_SILENT}${_PKG_DEBUG} \
- ${TOUCH} ${TOUCH_ARGS} ${ERROR_DIR}/${.TARGET} ${WARNING_DIR}/${.TARGET}
- ${_PKG_SILENT}${_PKG_DEBUG} \
${PKG_FILELIST_CMD} | ${SORT} | ${SED} 's,\\,\\\\,g' | \
while read file; do \
${_CHECK_INTERP_SKIP_FILTER}; \
${SHCOMMENT} "[$$file]"; \
interp=`${SED} -n -e '1s/^#![[:space:]]*\([^[:space:]]*\).*/\1/p' -e '1q' < "$$file"` \
- || { ${ECHO} "[check-interpreter.mk] sed(1) failed for \"$$file\"." >> ${WARNING_DIR}/${.TARGET}; \
+ || { ${DELAYED_WARNING_MSG} "[check-interpreter.mk] sed(1) failed for \"$$file\"."; \
continue; \
}; \
case $$interp in \
@@ -44,9 +40,9 @@ check-interpreter: error-check
esac; \
if ${TEST} ! -f "$$interp"; then \
if ${TEST} -x "$$file"; then \
- ${ECHO} "[check-interpreter.mk] The interpreter \"$$interp\" of \"$$file\" does not exist." >> ${ERROR_DIR}/${.TARGET}; \
+ ${DELAYED_ERROR_MSG} "[check-interpreter.mk] The interpreter \"$$interp\" of \"$$file\" does not exist."; \
else \
- ${ECHO} "[check-interpreter.mk] The interpreter \"$$interp\" of \"$$file\" does not exist." >> ${WARNING_DIR}/${.TARGET}; \
+ ${DELAYED_WARNING_MSG} "[check-interpreter.mk] The interpreter \"$$interp\" of \"$$file\" does not exist."; \
fi; \
fi; \
done