From 8596d76d0be263d358119363a80b04481d7a6ae7 Mon Sep 17 00:00:00 2001 From: asami Date: Sat, 24 Jun 1995 10:27:23 +0000 Subject: [PATCH] Add a "checkpatch" target that does a "patch -C" instead of a "patch". Note that the two "touch"s I took out from do-patch shouldn't have been there in the first place. This target may give incorrent results if two separate patches deal with the same file, and their hunks overlap. (But having those kinds of patches are bad, and they should be merged anyway.) Reviewed by: hsu --- share/mk/bsd.port.mk | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk index ef9df00c5ed8..76f25614e451 100644 --- a/share/mk/bsd.port.mk +++ b/share/mk/bsd.port.mk @@ -3,7 +3,7 @@ # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. # -# $Id: bsd.port.mk,v 1.164 1995/05/29 13:46:38 asami Exp $ +# $Id: bsd.port.mk,v 1.165 1995/06/06 10:56:34 asami Exp $ # # Please view me with 4 column tabs! @@ -140,6 +140,9 @@ # package - Create a package from an _installed_ port. # describe - Try to generate a one-line description for each port for # use in INDEX files and the like. +# checkpatch - Do a "patch -C" instead of a "patch". Note that it may +# give incorrect results if multiple patches deal with +# the same file. # checksum - Use files/md5 to ensure that your distfiles are valid # makesum - Generate files/md5 (only do this for your own ports!) # @@ -228,6 +231,11 @@ PATCH_ARGS?= -d ${WRKSRC} --forward --quiet -E ${PATCH_STRIP} PATCH_DIST_ARGS?= -d ${WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP} .endif +.if defined(PATCH_CHECK_ONLY) +PATCH_ARGS+= -C +PATCH_DIST_ARGS+= -C +.endif + EXTRACT_CMD?= tar EXTRACT_SUFX?= .tar.gz # Backwards compatability. @@ -518,7 +526,6 @@ do-patch: ${PATCH} ${PATCH_ARGS} < $$i; \ done; \ fi - @${TOUCH} ${TOUCH_FLAGS} ${PATCH_COOKIE} .else @if [ -d ${PATCHDIR} ]; then \ ${ECHO_MSG} "===> Applying FreeBSD patches for ${PKGNAME}" ; \ @@ -526,7 +533,6 @@ do-patch: do ${PATCH} ${PATCH_ARGS} < $$i; \ done;\ fi - @${TOUCH} ${TOUCH_FLAGS} ${PATCH_COOKIE} .endif .endif @@ -679,8 +685,19 @@ ${PATCH_COOKIE}: DEPENDS="${DEPENDS}" X11BASE=${X11BASE} \ sh ${SCRIPTDIR}/post-patch; \ fi +.if !defined(PATCH_CHECK_ONLY) @${TOUCH} ${TOUCH_FLAGS} ${PATCH_COOKIE} .endif +.endif + +# Checkpatch +# +# Special target to verify patches + +.if !target(checkpatch) +checkpatch: + @${MAKE} PATCH_CHECK_ONLY=yes ${.MAKEFLAGS} patch +.endif # Configure