Add a knob PKGSRC_SHOW_PATCH_ERRORMSG to control whether the newly

verbose message displayed on patch failure is in fact displayed on
patch failure. It defaults to "no" if PKG_DEVELOPER is defined,
"yes" otherwise. While here, rename PKG_PATCH_FAIL to PKGSRC_PATCH_FAIL.
This commit is contained in:
schmonz 2004-08-25 04:09:10 +00:00
parent da7a154ccf
commit 71f7ba2993
2 changed files with 19 additions and 6 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: bsd.pkg.defaults.mk,v 1.277 2004/08/10 05:59:45 schmonz Exp $
# $NetBSD: bsd.pkg.defaults.mk,v 1.278 2004/08/25 04:09:10 schmonz Exp $
#
# A file providing defaults for pkgsrc and the packages collection.
@ -119,6 +119,15 @@ PKGSRC_SHOW_BUILD_DEFS?=yes
# Possible: "yes", not "yes"
# Default: "yes"
.if defined(PKG_DEVELOPER)
PKGSRC_SHOW_PATCH_ERRORMSG?=no
.else
PKGSRC_SHOW_PATCH_ERRORMSG?=yes
.endif
# Print a potentially helpful error message when the "patch" stage fails
# Possible: "yes", not "yes"
# Default: "no" if PKG_DEVELOPER is defined, "yes" otherwise
PKGSRC_RUN_TEST?= no
# Run test target before install
# Possible: yes, no

View file

@ -1,4 +1,4 @@
# $NetBSD: bsd.pkg.mk,v 1.1492 2004/08/24 00:27:13 tv Exp $
# $NetBSD: bsd.pkg.mk,v 1.1493 2004/08/25 04:09:10 schmonz Exp $
#
# This file is in the public domain.
#
@ -568,7 +568,10 @@ PATCH_DIST_CAT?= { case $$patchfile in \
PATCH_DIST_CAT.${i:S/=/--/}?= { patchfile=${i}; ${PATCH_DIST_CAT}; }
.endfor
PKG_PATCH_FAIL= \
.if empty(PKGSRC_SHOW_PATCH_ERRORMSG:M[yY][eE][sS])
PKGSRC_PATCH_FAIL= exit 1
.else
PKGSRC_PATCH_FAIL= \
if [ -n "${PKG_OPTIONS}" ] || [ -n "${_LOCALPATCHFILES}" ]; then \
${ECHO} "=========================================================================="; \
${ECHO}; \
@ -577,6 +580,7 @@ if [ -n "${PKG_OPTIONS}" ] || [ -n "${_LOCALPATCHFILES}" ]; then \
${ECHO}; \
${ECHO} "=========================================================================="; \
fi; exit 1
.endif
EXTRACT_SUFX?= .tar.gz
@ -2085,7 +2089,7 @@ do-patch: uptodate-digest
fi; \
${PATCH_DIST_CAT.${i:S/=/--/}} | \
${PATCH} ${PATCH_DIST_ARGS.${i:S/=/--/}} \
|| { ${ECHO} "Patch ${i} failed"; ${PKG_PATCH_FAIL}; }
|| { ${ECHO} "Patch ${i} failed"; ${PKGSRC_PATCH_FAIL}; }
. endfor
. endif
${_PKG_SILENT}${_PKG_DEBUG} \
@ -2162,11 +2166,11 @@ do-patch: uptodate-digest
fuzz=""; \
${PATCH} -v > /dev/null 2>&1 && fuzz="${PATCH_FUZZ_FACTOR}"; \
${PATCH} $$fuzz ${PATCH_ARGS} < $$i || \
{ ${ECHO} Patch $$i failed ; ${PKG_PATCH_FAIL}; }; \
{ ${ECHO} Patch $$i failed ; ${PKGSRC_PATCH_FAIL}; }; \
done; \
if [ "X$$fail" != "X" ]; then \
${ECHO_MSG} "Patching failed due to modified patch file(s): $$fail"; \
${PKG_PATCH_FAIL}; \
${PKGSRC_PATCH_FAIL}; \
fi; \
fi
.endif