diff options
author | jlam <jlam@pkgsrc.org> | 2006-06-09 13:59:06 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2006-06-09 13:59:06 +0000 |
commit | 8c10d39139a31e48ae30b4909f6a27c1710c0a8c (patch) | |
tree | bc3ee1d8414671473ac53f6468293fea0563cf1d /mk | |
parent | 0a42a052a223d1bf586ea1cdb2743b3276b2a3ff (diff) | |
download | pkgsrc-8c10d39139a31e48ae30b4909f6a27c1710c0a8c.tar.gz |
Introduce the capability to gather all the warnings and errors that
are generated for a target and output them all at once at the conclusion
of the target's invocation. The implementation is in bsd.pkg.error.mk,
which defines a macro target "error-check" that will print out any
non-empty warning and error files in ${WARNING_DIR} and ${ERROR_DIR}
and exit appropriately if there were errors.
Convert some targets that were just long sequences of ${ERROR_MSG} or
${WARNING_MSG} within a single shell statement to use the new delayed
error output via error-check.
Modify the compiler "fail" wrappers for C++ and Fortran to be less
verbose during invocation. Instead collect the warnings and only
print them at the end of the completed phase, e.g. after "configure"
and/or "build" completes.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.error.mk | 53 | ||||
-rw-r--r-- | mk/bsd.pkg.mk | 13 | ||||
-rw-r--r-- | mk/check/check-files.mk | 49 | ||||
-rw-r--r-- | mk/check/check-interpreter.mk | 30 | ||||
-rw-r--r-- | mk/check/check-shlibs.mk | 44 | ||||
-rw-r--r-- | mk/check/check-wrkref.mk | 50 | ||||
-rw-r--r-- | mk/compiler.mk | 10 | ||||
-rw-r--r-- | mk/depends/depends.mk | 3 | ||||
-rw-r--r-- | mk/extract/extract.mk | 3 | ||||
-rw-r--r-- | mk/flavor/pkg/install.mk | 41 | ||||
-rw-r--r-- | mk/install/install.mk | 3 | ||||
-rw-r--r-- | mk/package/package.mk | 3 | ||||
-rw-r--r-- | mk/patch/patch.mk | 3 | ||||
-rw-r--r-- | mk/tools/bsd.tools.mk | 3 |
14 files changed, 185 insertions, 123 deletions
diff --git a/mk/bsd.pkg.error.mk b/mk/bsd.pkg.error.mk new file mode 100644 index 00000000000..4c744e5a1a1 --- /dev/null +++ b/mk/bsd.pkg.error.mk @@ -0,0 +1,53 @@ +# $NetBSD: bsd.pkg.error.mk,v 1.1 2006/06/09 13:59:06 jlam Exp $ + +ERROR_DIR= ${WRKDIR}/.error +WARNING_DIR= ${WRKDIR}/.warning + +makedirs: ${ERROR_DIR} ${WARNING_DIR} +${ERROR_DIR} ${WARNING_DIR}: + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET} + +.PHONY: error-check + +###################################################################### +### error-check (PRIVATE) +###################################################################### +### error-check is a macro target that will peek in the warning and +### error directories to check for the presence of any files. If they +### exist and are non-empty, then they are assumed to be message files +### and will be outputted then removed. If they are from the error +### directory, then the target will fail. +### +error-check: .USE + ${_PKG_SILENT}${_PKG_DEBUG} \ + ${RM} -f ${WARNING_DIR}/*.tmp; \ + ${TEST} -d ${WARNING_DIR} || exit 0; \ + cd ${WARNING_DIR}; \ + for file in ./*; do \ + ${TEST} "$$file" != "./*" || exit 0; \ + break; \ + done; \ + ${CAT} ./* | ${WARNING_CAT}; \ + ${RM} -f ./* + + ${_PKG_SILENT}${_PKG_DEBUG} \ + ${RM} -f ${ERROR_DIR}/*.tmp; \ + ${TEST} -d ${ERROR_DIR} || exit 0; \ + cd ${ERROR_DIR}; \ + for file in ./*; do \ + ${TEST} "$$file" != "./*" || exit 0; \ + break; \ + done; \ + ${CAT} * | ${ERROR_CAT}; \ + if ${_NONZERO_FILESIZE_P} ./*; then \ + ${RM} -f ./*; \ + exit 1; \ + fi + +###################################################################### +### error-clean (PRIVATE) +###################################################################### +### error-clean removes the error and warning directory and files. +### +error-clean: + ${_PKG_SILENT}${_PKG_DEBUG}${RM} -fr ${ERROR_DIR} ${WARNING_DIR} diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 955ee206169..35d5c6b34a4 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1848 2006/06/08 16:21:51 jlam Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1849 2006/06/09 13:59:06 jlam Exp $ # # This file is in the public domain. # @@ -27,6 +27,7 @@ .include "${PKGSRCDIR}/mk/extract/bsd.extract-vars.mk" .include "${PKGSRCDIR}/mk/patch/bsd.patch-vars.mk" .include "${PKGSRCDIR}/mk/install/bsd.install-vars.mk" +.include "${PKGSRCDIR}/mk/bsd.pkg.error.mk" .include "../../mk/bsd.hacks.mk" @@ -311,7 +312,7 @@ _WRAPPER_COOKIE= ${WRKDIR}/.wrapper_done _CONFIGURE_COOKIE= ${WRKDIR}/.configure_done _BUILD_COOKIE= ${WRKDIR}/.build_done _TEST_COOKIE= ${WRKDIR}/.test_done -_INTERACTIVE_COOKIE= .interactive_stage +_INTERACTIVE_COOKIE= ${.CURDIR}/.interactive_stage _NULL_COOKIE= ${WRKDIR}/.null # Miscellaneous overridable commands: @@ -1319,10 +1320,10 @@ test-cookie: # make i.e. without -j n) .PHONY: real-wrapper .PHONY: real-configure real-build real-test -real-wrapper: wrapper-message wrapper-vars pre-wrapper do-wrapper post-wrapper wrapper-cookie -real-configure: configure-message configure-vars pre-configure pre-configure-override do-configure post-configure configure-cookie -real-build: build-message build-vars pre-build do-build post-build build-cookie -real-test: test-message pre-test do-test post-test test-cookie +real-wrapper: wrapper-message wrapper-vars pre-wrapper do-wrapper post-wrapper wrapper-cookie error-check +real-configure: configure-message configure-vars pre-configure pre-configure-override do-configure post-configure configure-cookie error-check +real-build: build-message build-vars pre-build do-build post-build build-cookie error-check +real-test: test-message pre-test do-test post-test test-cookie error-check # su-target is a macro target that does just-in-time su-to-root before # reinvoking the make process as root. It acquires root privileges and diff --git a/mk/check/check-files.mk b/mk/check/check-files.mk index 976a76c3e92..3def14b5745 100644 --- a/mk/check/check-files.mk +++ b/mk/check/check-files.mk @@ -1,4 +1,4 @@ -# $NetBSD: check-files.mk,v 1.2 2006/06/07 20:28:59 jlam Exp $ +# $NetBSD: check-files.mk,v 1.3 2006/06/09 13:59:08 jlam Exp $ .if defined(PKG_DEVELOPER) CHECK_FILES?= yes @@ -65,7 +65,7 @@ _CHECK_FILES_SKIP_FILTER= ${GREP} -vx ${CHECK_FILES_SKIP:@f@-e ${f:Q}@} # These are the files generated and used by the check-files implementation # used across several check-files targets. # -# _CHECK_FILES_COOKIE.* are the cookie files that contain the error +# _CHECK_FILES_ERRMSG.* are the files that contain the error # messages discovered during each stage of file-checking. # # _CHECK_FILES_PRE.* are the file lists generated before any files @@ -77,23 +77,23 @@ _CHECK_FILES_SKIP_FILTER= ${GREP} -vx ${CHECK_FILES_SKIP:@f@-e ${f:Q}@} # The "pre" and "post" file lists are compared against each other to # determine if the package is installing files where it shouldn't be. # -_CHECK_FILES_COOKIE.prefix= ${WRKDIR}/.check_files_prefix_cookie +_CHECK_FILES_ERRMSG.prefix= ${ERROR_DIR}/check-files-prefix _CHECK_FILES_PRE.prefix= ${WRKDIR}/.prefix.pre _CHECK_FILES_POST.prefix= ${WRKDIR}/.prefix.post -_CHECK_FILES_COOKIE.sysconfdir= ${WRKDIR}/.check_files_sysconfdir_cookie +_CHECK_FILES_ERRMSG.sysconfdir= ${ERROR_DIR}/.check-files-sysconfdir _CHECK_FILES_PRE.sysconfdir= ${WRKDIR}/.sysconfdir.pre _CHECK_FILES_POST.sysconfdir= ${WRKDIR}/.sysconfdir.post -_CHECK_FILES_COOKIE.varbase= ${WRKDIR}/.check_files_varbase_cookie +_CHECK_FILES_ERRMSG.varbase= ${ERROR_DIR}/.check-files-varbase _CHECK_FILES_PRE.varbase= ${WRKDIR}/.varbase.pre _CHECK_FILES_POST.varbase= ${WRKDIR}/.varbase.post -_CHECK_FILES_COOKIES= # empty -_CHECK_FILES_COOKIES+= ${_CHECK_FILES_COOKIE.prefix} +_CHECK_FILES_ERRMSGS= # empty +_CHECK_FILES_ERRMSGS+= ${_CHECK_FILES_ERRMSG.prefix} .if empty(CHECK_FILES_STRICT:M[nN][oO]) -_CHECK_FILES_COOKIES+= ${_CHECK_FILES_COOKIE.sysconfdir} -_CHECK_FILES_COOKIES+= ${_CHECK_FILES_COOKIE.varbase} +_CHECK_FILES_ERRMSGS+= ${_CHECK_FILES_ERRMSG.sysconfdir} +_CHECK_FILES_ERRMSGS+= ${_CHECK_FILES_ERRMSG.varbase} .endif ########################################################################### @@ -164,9 +164,9 @@ ${_CHECK_FILES_PRE.varbase} ${_CHECK_FILES_POST.varbase}: # check-files targets and subtargets # .PHONY: check-files-prefix check-files-sysconfdir check-files-varbase -check-files-prefix: ${_CHECK_FILES_COOKIE.prefix} -check-files-sysconfdir: ${_CHECK_FILES_COOKIE.sysconfdir} -check-files-varbase: ${_CHECK_FILES_COOKIE.varbase} +check-files-prefix: ${_CHECK_FILES_ERRMSG.prefix} +check-files-sysconfdir: ${_CHECK_FILES_ERRMSG.sysconfdir} +check-files-varbase: ${_CHECK_FILES_ERRMSG.varbase} # The check-files target looks at the cookie files generated by the # check-files-* subtargets, and if they are non-empty, then they @@ -174,12 +174,11 @@ check-files-varbase: ${_CHECK_FILES_COOKIE.varbase} # subtarget. # .PHONY: check-files -check-files: ${_CHECK_FILES_COOKIES} - ${_PKG_SILENT}${_PKG_DEBUG}${STEP_MSG} \ - "Checking file-check results for ${PKGNAME}" - @${CAT} ${_CHECK_FILES_COOKIES} | ${ERROR_CAT} - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${_ZERO_FILESIZE_P} ${_CHECK_FILES_COOKIES} || exit 1 +check-files: check-files-message ${_CHECK_FILES_ERRMSGS} error-check + +.PHONY: check-files-message +check-files-message: + @${STEP_MSG} "Checking file-check results for ${PKGNAME}" # Check ${PREFIX} for files which are not listed in the generated ${PLIST} # and vice-versa. @@ -253,10 +252,10 @@ ${_CHECK_FILES_EXTRA}: ${_CHECK_FILES_EXPECTED} ${_CHECK_FILES_ADDED} ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} .if defined(NO_PKG_REGISTER) -${_CHECK_FILES_COOKIE.prefix}: +${_CHECK_FILES_ERRMSG.prefix}: ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET} .else -${_CHECK_FILES_COOKIE.prefix}: \ +${_CHECK_FILES_ERRMSG.prefix}: \ ${_CHECK_FILES_DELETED} \ ${_CHECK_FILES_MISSING} \ ${_CHECK_FILES_MISSING_REAL} \ @@ -297,10 +296,10 @@ ${_CHECK_FILES_COOKIE.prefix}: \ # not copied into place by the INSTALL scripts. # .if defined(NO_PKG_REGISTER) -${_CHECK_FILES_COOKIE.sysconfdir}: +${_CHECK_FILES_ERRMSG.sysconfdir}: ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET} .else -${_CHECK_FILES_COOKIE.sysconfdir}: \ +${_CHECK_FILES_ERRMSG.sysconfdir}: \ ${_CHECK_FILES_PRE.sysconfdir} \ ${_CHECK_FILES_POST.sysconfdir} ${_PKG_SILENT}${_PKG_DEBUG} \ @@ -323,10 +322,10 @@ ${_CHECK_FILES_COOKIE.sysconfdir}: \ # not created by the INSTALL scripts. # .if defined(NO_PKG_REGISTER) -${_CHECK_FILES_COOKIE.varbase}: +${_CHECK_FILES_ERRMSG.varbase}: ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET} .else -${_CHECK_FILES_COOKIE.varbase}: \ +${_CHECK_FILES_ERRMSG.varbase}: \ ${_CHECK_FILES_PRE.varbase} \ ${_CHECK_FILES_POST.varbase} ${_PKG_SILENT}${_PKG_DEBUG} \ @@ -353,7 +352,7 @@ ${_CHECK_FILES_COOKIE.varbase}: \ check-clean: check-files-clean check-files-clean: ${_PKG_SILENT}${_PKG_DEBUG} \ - ${RM} -f ${_CHECK_FILES_COOKIES} \ + ${RM} -f ${_CHECK_FILES_ERRMSGS} \ ${_CHECK_FILES_PRE} ${_CHECK_FILES_POST} \ ${_CHECK_FILES_DIFF} ${_CHECK_FILES_ADDED} \ ${_CHECK_FILES_DELETED} ${_CHECK_FILES_EXPECTED} \ diff --git a/mk/check/check-interpreter.mk b/mk/check/check-interpreter.mk index 8cd4242469f..060568ab5c5 100644 --- a/mk/check/check-interpreter.mk +++ b/mk/check/check-interpreter.mk @@ -1,4 +1,4 @@ -# $NetBSD: check-interpreter.mk,v 1.3 2006/06/07 17:41:14 jlam Exp $ +# $NetBSD: check-interpreter.mk,v 1.4 2006/06/09 13:59:08 jlam Exp $ CHECK_INTERPRETER?= no @@ -15,17 +15,22 @@ _CHECK_INTERP_SKIP_FILTER+= ${PREFIX}/${_pattern_}|${_pattern_}) continue ;; _CHECK_INTERP_SKIP_FILTER+= *) ;; _CHECK_INTERP_SKIP_FILTER+= esac -########################################################################### -# check-interpreter target -# +###################################################################### +### check-interpreter (PRIVATE) +###################################################################### +### check-interpreter verifies that the interpreters for all installed +### scripts exist. +### .PHONY: check-interpreter -check-interpreter: - ${_PKG_SILENT}${_PKG_DEBUG}${STEP_MSG} \ - "Checking for non-existent script interpreters in ${PKGNAME}" +check-interpreter: error-check + @${STEP_MSG} "Checking for non-existent script interpreters" \ + "in ${PKGNAME}" +.if !defined(NO_PKG_REGISTER) + ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${ERROR_DIR}/${.TARGET} ${_PKG_SILENT}${_PKG_DEBUG} \ + exec 1>${ERROR_DIR}/${.TARGET}; \ ${PKG_FILELIST_CMD} | ${SORT} | ${SED} 's,\\,\\\\,g' | \ - { exitcode=0; \ - while read file; do \ + while read file; do \ ${_CHECK_INTERP_SKIP_FILTER}; \ ${SHCOMMENT} "[$$file]"; \ interp=`${SED} -n -e '1s/^#![[:space:]]*\([^[:space:]]*\).*/\1/p' -e '1q' < "$$file"` \ @@ -37,11 +42,10 @@ check-interpreter: esac; \ if ${TEST} ! -f "$$interp"; then \ if ${TEST} -x "$$file"; then \ - ${ERROR_MSG} "[check-interpreter.mk] The interpreter \"$$interp\" of \"$$file\" does not exist."; \ - exitcode=1; \ + ${ECHO} "[check-interpreter.mk] The interpreter \"$$interp\" of \"$$file\" does not exist."; \ else \ ${WARNING_MSG} "[check-interpreter.mk] The interpreter \"$$interp\" of \"$$file\" does not exist."; \ fi; \ fi; \ - done; \ - exit $$exitcode; } + done +.endif diff --git a/mk/check/check-shlibs.mk b/mk/check/check-shlibs.mk index bbeb6d4119f..57f98e68a17 100644 --- a/mk/check/check-shlibs.mk +++ b/mk/check/check-shlibs.mk @@ -1,4 +1,4 @@ -# $NetBSD: check-shlibs.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $ +# $NetBSD: check-shlibs.mk,v 1.2 2006/06/09 13:59:08 jlam Exp $ # For PKG_DEVELOPERs, cause some checks to be run automatically by default. .if defined(PKG_DEVELOPER) @@ -9,35 +9,41 @@ CHECK_SHLIBS?= no # All binaries and shared libraries. _CHECK_SHLIBS_ERE= /(bin/|sbin/|libexec/|lib/lib.*\.so|lib/lib.*\.dylib) -########################################################################### -# check-shlibs target -# +###################################################################### +### check-shlibs (PRIVATE) +###################################################################### +### check-shlibs verifies that all libraries used by the package can be +### found at run-time. +### .PHONY: check-shlibs +.if !empty(CHECK_SHLIBS_SUPPORTED:M[nN][oO]) check-shlibs: -.if !empty(CHECK_SHLIBS_SUPPORTED:M[yY][eE][sS]) && !defined(NO_PKG_REGISTER) - ${_PKG_SILENT}${_PKG_DEBUG}${STEP_MSG} \ - "Checking for missing run-time search paths in ${PKGNAME}" + @${DO_NADA} +.else +check-shlibs: error-check + @${STEP_MSG} "Checking for missing run-time search paths in ${PKGNAME}" +. if !defined(NO_PKG_REGISTER) + ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${ERROR_DIR}/${.TARGET} ${_PKG_SILENT}${_PKG_DEBUG} \ + exec 1>${ERROR_DIR}/${.TARGET}; \ case ${LDD:Q}"" in \ "") ldd=`${TYPE} ldd 2>/dev/null | ${AWK} '{ print $$NF }'` ;; \ *) ldd=${LDD:Q} ;; \ esac; \ ${TEST} -x "$$ldd" || exit 0; \ ${PKG_FILELIST_CMD} | \ - { ${EGREP} -h ${_CHECK_SHLIBS_ERE:Q} || ${TRUE}; } | \ - { while read file; do \ - ${TEST} -z ${PKG_VERBOSE:Q}"" || ${ECHO} "$$ldd $$file"; \ - err=`{ $$ldd $$file 2>&1 || ${TRUE}; } | { ${GREP} "not found" || ${TRUE}; }`; \ - if ${TEST} -n "$$err"; then \ - ${ECHO} "$$file: $$err"; \ - error=1; \ - fi; \ - done; \ - if ${TEST} "$$error" = 1; then \ + ${EGREP} -h ${_CHECK_SHLIBS_ERE:Q} | \ + while read file; do \ + err=`$$ldd $$file 2>&1 | ${GREP} "not found || ${TRUE}"`; \ + ${TEST} -z "$$err" || ${ECHO} "$$file: $$err"; \ + done + ${_PKG_SILENT}${_PKG_DEBUG} \ + exec 1>${ERROR_DIR}/${.TARGET}; \ + if ${_NONZERO_FILESIZE_P} ${ERROR_DIR}/${.TARGET}; then \ ${ECHO} "*** The above programs/libs will not find the listed shared libraries"; \ ${ECHO} " at runtime. Please fix the package (add -Wl,-R.../lib in the right"; \ ${ECHO} " places)!"; \ ${SHCOMMENT} Might not error-out for non-pkg-developers; \ - exit 1; \ - fi; } + fi +. endif .endif diff --git a/mk/check/check-wrkref.mk b/mk/check/check-wrkref.mk index 6baa150e5b1..c109bee6c9f 100644 --- a/mk/check/check-wrkref.mk +++ b/mk/check/check-wrkref.mk @@ -1,4 +1,4 @@ -# $NetBSD: check-wrkref.mk,v 1.3 2006/06/07 17:05:25 jlam Exp $ +# $NetBSD: check-wrkref.mk,v 1.4 2006/06/09 13:59:08 jlam Exp $ .if defined(PKG_DEVELOPER) CHECK_WRKREF?= tools @@ -30,36 +30,19 @@ _CHECK_WRKREF:= ${CHECK_WRKREF} _CHECK_WRKREF:= work # "work" is the "max" option .endif -########################################################################### -# check-wrkref target -# -_CHECK_WRKREF_FOUND= ${WRKDIR}/.check_wrkref_found - +###################################################################### +### check-wrkref (PRIVATE) +###################################################################### +### check-wrkref verifies that the installed files are free of +### hard-coded references to the work directory. +### .PHONY: check-wrkref -check-wrkref: check-wrkref-message check-wrkref-clean ${_CHECK_WRKREF_FOUND} - ${_PKG_SILENT}${_PKG_DEBUG} \ - if ${_ZERO_FILESIZE_P} ${_CHECK_WRKREF_FOUND}; then \ - ${DO_NADA}; \ - else \ - ${ERROR_MSG} "The following files still have references to the build directory."; \ - ${ERROR_MSG} "This is possibly an error that should be fixed by unwrapping"; \ - ${ERROR_MSG} "the files or adding missing tools to the package makefile!"; \ - ${ERROR_MSG} ""; \ - ${CAT} ${_CHECK_WRKREF_FOUND} | ${ERROR_CAT}; \ - exit 1; \ - fi - -.PHONY: check-wrkref-message -check-wrkref-message: +check-wrkref: error-check @${STEP_MSG} "Checking for work-directory references in ${PKGNAME}" - -check-clean: check-wrkref-clean -.PHONY: check-wrkref-clean -check-wrkref-clean: - ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${_CHECK_WRKREF_FOUND} - -${_CHECK_WRKREF_FOUND}: +.if !defined(NO_PKG_REGISTER) + ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${ERROR_DIR}/${.TARGET} ${_PKG_SILENT}${_PKG_DEBUG} \ + exec 1>${ERROR_DIR}/${.TARGET}; \ ${PKG_FILELIST_CMD} | ${SORT} | \ while read file; do \ ${_CHECK_WRKREF_SKIP_FILTER}; \ @@ -76,5 +59,12 @@ ${_CHECK_WRKREF_FOUND}: ${SED} -e "s|^|$$file: |"; \ ;; \ esac; \ - done > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} + done + ${_PKG_SILENT}${_PKG_DEBUG} \ + exec 1>${ERROR_DIR}/${.TARGET}; \ + if ${_NONZERO_FILESIZE_P} ${ERROR_DIR}/${.TARGET}; then \ + ${ECHO} "*** The above files still have references to the build directory."; \ + ${ECHO} " This is possibly an error that should be fixed by unwrapping"; \ + ${ECHO} " the files or adding missing tools to the package makefile!"; \ + fi +.endif diff --git a/mk/compiler.mk b/mk/compiler.mk index 7ffe0aaf7eb..36290b50981 100644 --- a/mk/compiler.mk +++ b/mk/compiler.mk @@ -1,4 +1,4 @@ -# $NetBSD: compiler.mk,v 1.50 2006/05/12 21:37:08 jlam Exp $ +# $NetBSD: compiler.mk,v 1.51 2006/06/09 13:59:08 jlam Exp $ # # This Makefile fragment implements handling for supported C/C++/Fortran # compilers. @@ -159,7 +159,13 @@ ${_FAIL_WRAPPER.FC}: fail-wrapper .PHONY: fail-wrapper fail-wrapper: .USE ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${ECHO:Q}" 1>&2 \"===>\"; "${ECHO:Q}" 1>&2 \"===> Please add USE_LANGUAGES+="${.TARGET:T:S/-fail-wrapper//:Q}" to the package Makefile.\"; "${ECHO:Q}" 1>&2 \"===>\"; exit 1" > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG} \ + exec 1>${.TARGET}; \ + ${ECHO} '#!'${TOOLS_SHELL:Q}; \ + ${ECHO} 'wrapperlog="$${TOOLS_WRAPPER_LOG-'${_TOOLS_WRAP_LOG:Q}'}"'; \ + ${ECHO} ${ECHO:Q} '"*** Please add USE_LANGUAGES+='${.TARGET:T:S/-fail-wrapper//:Q}' to the package Makefile." >> $$wrapperlog'; \ + ${ECHO} ${ECHO:Q} '"*** Please add USE_LANGUAGES+='${.TARGET:T:S/-fail-wrapper//:Q}' to the package Makefile." > ${WARNING_DIR}/${.TARGET:T}'; \ + ${ECHO} 'exit 1' ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} .if empty(USE_LANGUAGES:Mc++) diff --git a/mk/depends/depends.mk b/mk/depends/depends.mk index 6bb50b96dbf..d963c7ab2ac 100644 --- a/mk/depends/depends.mk +++ b/mk/depends/depends.mk @@ -1,4 +1,4 @@ -# $NetBSD: depends.mk,v 1.6 2006/06/08 15:45:06 jlam Exp $ +# $NetBSD: depends.mk,v 1.7 2006/06/09 13:59:08 jlam Exp $ ###################################################################### ### depends (PUBLIC) @@ -36,6 +36,7 @@ _REAL_DEPENDS_TARGETS+= depends-message _REAL_DEPENDS_TARGETS+= pre-depends-hook _REAL_DEPENDS_TARGETS+= depends-install _REAL_DEPENDS_TARGETS+= depends-cookie +_REAL_DEPENDS_TARGETS+= error-check .PHONY: real-depends real-depends: ${_REAL_DEPENDS_TARGETS} diff --git a/mk/extract/extract.mk b/mk/extract/extract.mk index 7ffce785ed2..41513acc437 100644 --- a/mk/extract/extract.mk +++ b/mk/extract/extract.mk @@ -1,4 +1,4 @@ -# $NetBSD: extract.mk,v 1.6 2006/06/09 08:20:30 jlam Exp $ +# $NetBSD: extract.mk,v 1.7 2006/06/09 13:59:08 jlam Exp $ # # The following variables may be set by the package Makefile and # specify how extraction happens: @@ -79,6 +79,7 @@ _REAL_EXTRACT_TARGETS+= pre-extract _REAL_EXTRACT_TARGETS+= do-extract _REAL_EXTRACT_TARGETS+= post-extract _REAL_EXTRACT_TARGETS+= extract-cookie +_REAL_EXTRACT_TARGETS+= error-check .PHONY: real-extract real-extract: ${_REAL_EXTRACT_TARGETS} diff --git a/mk/flavor/pkg/install.mk b/mk/flavor/pkg/install.mk index dafaef4e17b..0057e454f41 100644 --- a/mk/flavor/pkg/install.mk +++ b/mk/flavor/pkg/install.mk @@ -1,4 +1,4 @@ -# $NetBSD: install.mk,v 1.6 2006/06/08 08:01:53 rillig Exp $ +# $NetBSD: install.mk,v 1.7 2006/06/09 13:59:08 jlam Exp $ ###################################################################### ### install-check-conflicts (PRIVATE, pkgsrc/mk/install/install.mk) @@ -7,7 +7,7 @@ ### and and installed packages. ### .PHONY: install-check-conflicts -install-check-conflicts: +install-check-conflicts: error-check ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${WRKDIR}/.CONFLICTS .for _conflict_ in ${CONFLICTS} ${_PKG_SILENT}${_PKG_DEBUG} \ @@ -19,12 +19,12 @@ install-check-conflicts: .endfor ${_PKG_SILENT}${_PKG_DEBUG} \ ${TEST} -f ${WRKDIR}/.CONFLICTS || exit 0; \ - ${ERROR_MSG} "${PKGNAME} conflicts with installed package(s):"; \ - ${CAT} ${WRKDIR}/.CONFLICTS | ${SED} -e "s|^| |" | ${ERROR_CAT}; \ - ${ERROR_MSG} "They install the same files into the same place."; \ - ${ERROR_MSG} "Please remove conflicts first with pkg_delete(1)."; \ - ${RM} -f ${WRKDIR}/.CONFLICTS; \ - exit 1 + exec 1>${ERROR_DIR}/${.TARGET}; \ + ${ECHO} "${PKGNAME} conflicts with installed package(s):"; \ + ${CAT} ${WRKDIR}/.CONFLICTS | ${SED} -e "s|^| |"; \ + ${ECHO} "They install the same files into the same place."; \ + ${ECHO} "Please remove conflicts first with pkg_delete(1)."; \ + ${RM} -f ${WRKDIR}/.CONFLICTS ###################################################################### ### install-check-installed (PRIVATE, pkgsrc/mk/install/install.mk) @@ -33,22 +33,19 @@ install-check-conflicts: ### version) is already installed on the system. ### .PHONY: install-check-installed -install-check-installed: +install-check-installed: error-check ${_PKG_SILENT}${_PKG_DEBUG} \ found="`${_PKG_BEST_EXISTS} ${PKGWILDCARD:Q} || ${TRUE}`"; \ - case "$$found" in \ - "") ;; \ - *) ${ERROR_MSG} "$$found is already installed - perhaps an older version?"; \ - ${ERROR_MSG} "If so, you may use either of:"; \ - ${ERROR_MSG} " - \"pkg_delete $$found\" and \"${MAKE} reinstall\""; \ - ${ERROR_MSG} " to upgrade properly"; \ - ${ERROR_MSG} " - \"${MAKE} update\" to rebuild the package and all"; \ - ${ERROR_MSG} " of its dependencies"; \ - ${ERROR_MSG} " - \"${MAKE} replace\" to replace only the package without"; \ - ${ERROR_MSG} " re-linking dependencies, risking various problems."; \ - exit 1; \ - ;; \ - esac + ${TEST} -n "$$found" || exit 0; \ + exec 1>${ERROR_DIR}/${.TARGET}; \ + ${ECHO} "$$found is already installed - perhaps an older version?"; \ + ${ECHO} "If so, you may use either of:"; \ + ${ECHO} " - \"pkg_delete $$found\" and \"${MAKE} reinstall\""; \ + ${ECHO} " to upgrade properly"; \ + ${ECHO} " - \"${MAKE} update\" to rebuild the package and all"; \ + ${ECHO} " of its dependencies"; \ + ${ECHO} " - \"${MAKE} replace\" to replace only the package without"; \ + ${ECHO} " re-linking dependencies, risking various problems." ###################################################################### ### register-pkg (PRIVATE, pkgsrc/mk/install/install.mk) diff --git a/mk/install/install.mk b/mk/install/install.mk index 8b37216333c..960794e69a9 100644 --- a/mk/install/install.mk +++ b/mk/install/install.mk @@ -1,4 +1,4 @@ -# $NetBSD: install.mk,v 1.5 2006/06/08 15:47:10 jlam Exp $ +# $NetBSD: install.mk,v 1.6 2006/06/09 13:59:08 jlam Exp $ ###################################################################### ### install (PUBLIC) @@ -133,6 +133,7 @@ _INSTALL_ALL_TARGETS+= post-install-script _INSTALL_ALL_TARGETS+= register-pkg .endif _INSTALL_ALL_TARGETS+= privileged-install-hook +_INSTALL_ALL_TARGETS+= error-check .if empty(CHECK_SHLIBS:M[nN][oO]) privileged-install-hook: check-shlibs diff --git a/mk/package/package.mk b/mk/package/package.mk index 0c799e316b3..ce02184721b 100644 --- a/mk/package/package.mk +++ b/mk/package/package.mk @@ -1,4 +1,4 @@ -# $NetBSD: package.mk,v 1.5 2006/06/08 15:48:42 jlam Exp $ +# $NetBSD: package.mk,v 1.6 2006/06/09 13:59:08 jlam Exp $ _PACKAGE_COOKIE= ${WRKDIR}/.package_done @@ -69,6 +69,7 @@ package-cookie: _PACKAGE_ALL_TARGETS+= package-check-installed _PACKAGE_ALL_TARGETS+= package-create _PACKAGE_ALL_TARGETS+= package-warnings +_PACKAGE_ALL_TARGETS+= error-check .PHONY: package-all su-package-all package-all: su-target diff --git a/mk/patch/patch.mk b/mk/patch/patch.mk index e39ffb711c2..cea306ce9fc 100644 --- a/mk/patch/patch.mk +++ b/mk/patch/patch.mk @@ -1,4 +1,4 @@ -# $NetBSD: patch.mk,v 1.3 2006/06/08 08:01:53 rillig Exp $ +# $NetBSD: patch.mk,v 1.4 2006/06/09 13:59:08 jlam Exp $ # # The following variables may be set in a package Makefile and control # how pkgsrc patches are applied. @@ -83,6 +83,7 @@ _REAL_PATCH_TARGETS+= pre-patch _REAL_PATCH_TARGETS+= do-patch _REAL_PATCH_TARGETS+= post-patch _REAL_PATCH_TARGETS+= patch-cookie +_REAL_PATCH_TARGETS+= error-check .PHONY: real-patch real-patch: ${_REAL_PATCH_TARGETS} diff --git a/mk/tools/bsd.tools.mk b/mk/tools/bsd.tools.mk index 1a555248e61..f441ca5fc15 100644 --- a/mk/tools/bsd.tools.mk +++ b/mk/tools/bsd.tools.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.tools.mk,v 1.35 2006/06/06 06:30:29 jlam Exp $ +# $NetBSD: bsd.tools.mk,v 1.36 2006/06/09 13:59:08 jlam Exp $ # # Copyright (c) 2005, 2006 The NetBSD Foundation, Inc. # All rights reserved. @@ -82,6 +82,7 @@ release-tools-lock: release-lock _REAL_TOOLS_TARGETS+= tools-message _REAL_TOOLS_TARGETS+= tools-vars _REAL_TOOLS_TARGETS+= override-tools +_REAL_TOOLS_TARGETS+= error-check .PHONY: real-tools real-tools: ${_REAL_TOOLS_TARGETS} |