summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorschmonz <schmonz>2004-08-25 04:09:10 +0000
committerschmonz <schmonz>2004-08-25 04:09:10 +0000
commit1252b4a3e31a7c580bddd24000949f8d8988f098 (patch)
treedfc6fb6c61cfaa78c9b7c85cb2618cd29a341885 /mk
parent768f3119456122f9c8452f1faf6162b4cb65d211 (diff)
downloadpkgsrc-1252b4a3e31a7c580bddd24000949f8d8988f098.tar.gz
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.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.defaults.mk11
-rw-r--r--mk/bsd.pkg.mk14
2 files changed, 19 insertions, 6 deletions
diff --git a/mk/bsd.pkg.defaults.mk b/mk/bsd.pkg.defaults.mk
index 2d33a8004f7..f3379243a42 100644
--- a/mk/bsd.pkg.defaults.mk
+++ b/mk/bsd.pkg.defaults.mk
@@ -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
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 941c9aa1bb5..55818a28a47 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -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