From owner-freebsd-ports Sun Nov 10 15:20: 6 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE55A37B401 for ; Sun, 10 Nov 2002 15:20:02 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E75443E77 for ; Sun, 10 Nov 2002 15:20:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gAANK1x3084450 for ; Sun, 10 Nov 2002 15:20:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gAANK1l2084449; Sun, 10 Nov 2002 15:20:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5D9E37B401 for ; Sun, 10 Nov 2002 15:11:20 -0800 (PST) Received: from pike.mail.pike.ru (pike.mail.pike.ru [194.135.18.234]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A44943E42 for ; Sun, 10 Nov 2002 15:11:19 -0800 (PST) (envelope-from babolo@cicuta.babolo.ru) Received: (qmail 54098 invoked from network); 10 Nov 2002 23:14:45 -0000 Received: from babolo.ru (HELO cicuta.babolo.ru) (194.58.226.160) by pike.mail.pike.ru with SMTP; 10 Nov 2002 23:14:45 -0000 Received: (nullmailer pid 704 invoked by uid 136); Sun, 10 Nov 2002 23:11:23 -0000 Message-Id: <1036969883.424961.703.nullmailer@cicuta.babolo.ru> Date: Mon, 11 Nov 2002 02:11:23 +0300 From: "Alexandr A.Babaylov" <"."@babolo.ru> Reply-To: "Alexandr A.Babaylov" <"."@babolo.ru> To: FreeBSD-gnats-submit@FreeBSD.org Cc: @cicuta.babolo.ru X-Send-Pr-Version: 3.113 Subject: ports/45200: Options to use local patches in ports tree Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 45200 >Category: ports >Synopsis: Options to use local patches in ports tree >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Nov 10 15:20:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Alexandr A. Babaylov >Release: FreeBSD 4.7-STABLE i386 >Organization: home >Environment: System: FreeBSD cicuta.babolo.ru 4.7-STABLE FreeBSD 4.7-STABLE #0: Sat Nov 9 21:54:50 MSK 2002 babolo@cicuta.babolo.ru:/tmp/babolo/usr/src/sys/cicuta i386 >Description: A lot of local patches live in it own directory tree (for CVSing) but with a need to be automatically applied every build. >How-To-Repeat: It is easy to use local patch or two with some port. But if number of it grows: 0cicuta~(2)>find /home/babolo/ports -type f | wc 956 956 47746 they need separate directory with separate CVS >Fix: Index: bsd.port.mk =================================================================== RCS file: /home/CVShome/FreeBSD/ports/Mk/bsd.port.mk,v retrieving revision 1.427 diff -u -r1.427 bsd.port.mk --- bsd.port.mk 3 Nov 2002 05:43:49 -0000 1.427 +++ bsd.port.mk 10 Nov 2002 22:10:05 -0000 @@ -96,6 +96,15 @@ # This variable supercedes CD_MOUNTPT, which is # obsolete. # +# This variables control local modifications. +# +# LOCAL_PATCHDIR_PREFIX - Root of directory tree similar to ports +# directory tree with local patches (and possibly +# local ports). +# WITHOUT_LOCAL_PATCHDIR - Should never be used in official ports tree. +# Set this variable in local ports to not clash +# local pathes themselves. +# # Set these if your port should not be built under certain circumstances. # These are string variables; you should set them to the reason why # they are necessary. @@ -708,6 +717,7 @@ FILESDIR?= ${MASTERDIR}/files SCRIPTDIR?= ${MASTERDIR}/scripts PKGDIR?= ${MASTERDIR} +LOCAL_PATCHDIR?= ${LOCAL_PATCHDIR_PREFIX}/${PATCHDIR} .if defined(USE_IMAKE) && !defined(USE_X_PREFIX) USE_X_PREFIX= yes @@ -2322,6 +2332,35 @@ done; \ fi; \ fi +.if defined(LOCAL_PATCHDIR_PREFIX) && !defined(WITHOUT_LOCAL_PATCHDIR) + @if [ -d ${LOCAL_PATCHDIR_PREFIX}/ ]; then \ + if [ "`echo ${LOCAL_PATCHDIR}/patch-*`" != "${LOCAL_PATCHDIR}/patch-*" ]; then \ + ${ECHO_MSG} "===> Applying LOCAL patches for ${PKGNAME}" ; \ + PATCHES_APPLIED="" ; \ + for i in ${LOCAL_PATCHDIR}/patch-*; do \ + case $$i in \ + *.orig|*.rej|*~|*,v) \ + ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \ + ;; \ + *) \ + if [ ${PATCH_DEBUG_TMP} = yes ]; then \ + ${ECHO_MSG} "===> Applying LOCAL patch $$i" ; \ + fi; \ + if ${PATCH} ${PATCH_ARGS} < $$i ; then \ + PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \ + else \ + ${ECHO_MSG} `${ECHO} ">> Patch $$i failed to apply cleanly." | ${SED} "s|${LOCAL_PATCHDIR}/||"` ; \ + if [ x"$$PATCHES_APPLIED" != x"" ]; then \ + ${ECHO_MSG} `${ECHO} ">> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${LOCAL_PATCHDIR}/||g"` ; \ + fi; \ + ${FALSE} ; \ + fi; \ + ;; \ + esac; \ + done; \ + fi; \ + fi +.endif .endif # Configure >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message