summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authoragc <agc>1999-11-12 10:34:47 +0000
committeragc <agc>1999-11-12 10:34:47 +0000
commitd3bdbc24a483da030e490b9f7e4e63e6fa61b905 (patch)
treeea8fd823a74fad05728e512542b0927b1fb1e18d /mk
parent5c260afd2ea841d6c515b589f5ad122b4b278b30 (diff)
downloadpkgsrc-d3bdbc24a483da030e490b9f7e4e63e6fa61b905.tar.gz
Introduce a variable called PATCH_FUZZ_FACTOR, default "", and use it
if patch(1) is smart enough (i.e. not Solaris by default). Also introduce a second patch stage (in the package patch phase, not the distribution patches), whereby a misapplied patch with ${PATCH_FUZZ_FACTOR} will be tried again without a fuzz factor. This will fail on package patches which patch many files, but these should be fixed anyway.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk12
-rw-r--r--mk/mk.conf.example8
2 files changed, 15 insertions, 5 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 9baac8e3aac..813605353b9 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.365 1999/11/10 10:50:30 agc Exp $
+# $NetBSD: bsd.pkg.mk,v 1.366 1999/11/12 10:34:47 agc Exp $
#
# This file is in the public domain.
#
@@ -480,7 +480,7 @@ LN?= /bin/ln
MKDIR?= /bin/mkdir -p
MTREE?= ${LOCALBASE}/bsd/bin/mtree
MV?= /bin/mv
-PATCH?= /usr/bin/patch -F0
+PATCH?= /usr/bin/patch
PAX?= /usr/local/bsd/bin/pax
PKG_ADD?= ${LOCALBASE}/bsd/bin/pkg_add
PKG_CREATE?= ${LOCALBASE}/bsd/bin/pkg_create
@@ -524,7 +524,7 @@ LN?= /bin/ln
MKDIR?= /bin/mkdir -p
MTREE?= /usr/sbin/mtree
MV?= /bin/mv
-PATCH?= /usr/bin/patch -F0
+PATCH?= /usr/bin/patch
PAX?= /bin/pax
PKG_ADD?= /usr/sbin/pkg_add
PKG_CREATE?= /usr/sbin/pkg_create
@@ -1106,7 +1106,11 @@ do-patch:
if [ ${PATCH_DEBUG_TMP} = yes ]; then \
${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
fi; \
- ${PATCH} ${PATCH_ARGS} < $$i || ( ${ECHO} Patch $$i failed ; exit 1 ) ; \
+ fuzz=""; \
+ ${PATCH} -v > /dev/null 2>&1 && fuzz="${PATCH_FUZZ_FACTOR}"; \
+ ${PATCH} $$fuzz ${PATCH_ARGS} < $$i || \
+ ( ${ECHO} "!!! Fuzzy patch $$i !!!"; ${PATCH} ${PATCH_ARGS} < $$i) || \
+ ( ${ECHO} Patch $$i failed ; exit 1 ) ; \
done; \
if [ "X$$fail" != "X" ]; then \
${ECHO_MSG} "Patching failed due to modified patch file(s): $$fail"; \
diff --git a/mk/mk.conf.example b/mk/mk.conf.example
index e75ed3a9ac6..bda7529b711 100644
--- a/mk/mk.conf.example
+++ b/mk/mk.conf.example
@@ -1,4 +1,4 @@
-# $NetBSD: mk.conf.example,v 1.95 1999/11/10 10:37:12 agc Exp $
+# $NetBSD: mk.conf.example,v 1.96 1999/11/12 10:34:47 agc Exp $
#
# Sample /etc/mk.conf file, which can be used to set specific values
@@ -99,6 +99,12 @@
# Possible: defined, not defined
# Default: not defined
+#PATCH_FUZZ_FACTOR= # Fuzz factor to use when applying patches
+ # Will only be applied when using a patch
+ # that understands -F
+ # Possible: "-Fn" where n is a number, none
+ # Default: none
+
#ACCEPTABLE_LICENSES= shareware no-commercial-use fee-based-commercial-use
# Whitespace-delimited list of the types of
# license which are acceptable for installation.