From owner-freebsd-ports@freebsd.org Tue Jan 3 10:31:55 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8689BC9D517 for ; Tue, 3 Jan 2017 10:31:55 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 72CCC1147 for ; Tue, 3 Jan 2017 10:31:55 +0000 (UTC) (envelope-from julian@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 72187C9D516; Tue, 3 Jan 2017 10:31:55 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71B78C9D515 for ; Tue, 3 Jan 2017 10:31:55 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A8071146 for ; Tue, 3 Jan 2017 10:31:54 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-237-203.lns20.per1.internode.on.net [121.45.237.203]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v03AVoKS054329 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 3 Jan 2017 02:31:53 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: suggested patch for bsd.ports.mk To: "ports@FreeBSD.org" References: From: Julian Elischer Message-ID: <6453cdb9-b27a-e061-7249-51d84dbaefcc@freebsd.org> Date: Tue, 3 Jan 2017 18:31:44 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2017 10:31:55 -0000 Sometime ago I proposed the following change. I got several "yes please" from members of the public, but no actionable response from members of the ports group So I am asking again. As a src committer I don't feel qualified to do the commit myself and would like a guide/mentor for the task if I'm to do it myself. Julian On 13/05/2016 12:11 AM, Julian Elischer wrote: > This patch is pretty self explanatory. > > it allows us to keep patches for various ports separately in a > sparse hierarchy while not having to write to the ports tree itself. > > In case the list scrubs hte text attachment (diff) here's the > description part of the diff. > > >==== //depot/bugatti/FreeBSD-ports-PZ/10.1/Mk/bsd.port.mk#2 (text) > ==== > > @@ -791,6 +791,11 @@ > # The patches specified by this variable will be > # applied after the normal distribution patches but > # before those in ${PATCHDIR}. > +# EXTRA_PATCH_TREE - where to find extra 'out-of-tree' patches > +# Points to a directory hierarchy with the same > layout > +# as the ports tree, where local patches can be > found. > +# This allows a third party to keep their patches in > +# some other source control system if needed. > # PATCH_WRKSRC - Directory to apply patches in. > # Default: ${WRKSRC} > # > > If anyone thinks this is a good idea, I'd like it to go in as we > have to maintain it.. > I could commit it myself but haven't had my ports wings awarded yet.. > > the actual patch is: ==== //depot/bugatti/FreeBSD-ports-PZ/10.1/Mk/bsd.port.mk#2 (text) ==== @@ -749,6 +749,11 @@ # The patches specified by this variable will be # applied after the normal distribution patches but # before those in ${PATCHDIR}. +# EXTRA_PATCH_TREE - where to find extra 'out-of-tree' patches +# Points to a directory hierarchy with the same layout +# as the ports tree, where local patches can be found. +# This allows a third party to keep their patches in +# some other source control system if needed. # PATCH_WRKSRC - Directory to apply patches in. # Default: ${WRKSRC} # @@ -3145,6 +3150,36 @@ done; \ fi; \ fi +.if defined(EXTRA_PATCH_TREE) + @set -e ;\ + if [ -d ${EXTRA_PATCH_TREE}/${PKGORIGIN} ]; then \ + if [ "`${ECHO_CMD} ${EXTRA_PATCH_TREE}/${PKGORIGIN}/patch-*`" != "${EXTRA_PATCH_TREE}/${PKGORIGIN}/patch-*" ]; then \ + ${ECHO_MSG} "===> Applying local patches for ${PKGNAME}" ; \ + PATCHES_APPLIED="" ; \ + for i in ${EXTRA_PATCH_TREE}/${PKGORIGIN}/patch-*; do \ + case $$i in \ + *.orig|*.rej|*~|*,v) \ + ${ECHO_MSG} "===> Ignoring local 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_CMD} "=> Local patch $$i failed to apply cleanly." | ${SED} "s|${EXTRA_PATCH_TREE}/${PKGORIGIN}/||"` ; \ + if [ x"$$PATCHES_APPLIED" != x"" -a ${PATCH_SILENT} != "yes" ]; then \ + ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${EXTRA_PATCH_TREE}/${PKGORIGIN}/||g"` ; \ + fi; \ + ${FALSE} ; \ + fi; \ + ;; \ + esac; \ + done; \ + fi; \ + fi +.endif .endif .if !target(run-autotools-fixup)