From owner-freebsd-ports@FreeBSD.ORG Tue Dec 2 20:00:03 2008 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BACC81065670 for ; Tue, 2 Dec 2008 20:00:03 +0000 (UTC) (envelope-from lambert@lambertfam.org) Received: from sysmon.tcworks.net (sysmon.tcworks.net [65.66.76.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6E9358FC12 for ; Tue, 2 Dec 2008 20:00:03 +0000 (UTC) (envelope-from lambert@lambertfam.org) Received: from sysmon.tcworks.net (localhost [127.0.0.1]) by sysmon.tcworks.net (8.13.1/8.13.1) with ESMTP id mB2JOAqI089028 for ; Tue, 2 Dec 2008 13:24:10 -0600 (CST) (envelope-from lambert@lambertfam.org) Received: (from lambert@localhost) by sysmon.tcworks.net (8.13.1/8.13.1/Submit) id mB2JOA6I089027 for ports@freebsd.org; Tue, 2 Dec 2008 13:24:10 -0600 (CST) (envelope-from lambert@lambertfam.org) X-Authentication-Warning: sysmon.tcworks.net: lambert set sender to lambert@lambertfam.org using -f Date: Tue, 2 Dec 2008 13:24:10 -0600 From: Scott Lambert To: ports@freebsd.org Message-ID: <20081202192410.GA69963@sysmon.tcworks.net> Mail-Followup-To: ports@freebsd.org References: <20081202180743.GB70240@hades.panopticon> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081202180743.GB70240@hades.panopticon> User-Agent: Mutt/1.4.2.2i Cc: Subject: Re: Proposal: mechanism for local patches X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2008 20:00:03 -0000 On Tue, Dec 02, 2008 at 09:07:43PM +0300, Dmitry Marakasov wrote: > * G. Paul Ziemba (pz-freebsd-ports@ziemba.us) wrote: > > > In hopes of stimulating some discussion, I propose a new variable, > > LOCAL_PATCHES (or maybe SITE_PATCHES), that would behave just like > > EXTRA_PATCHES, except that it would be designated specifically for > > site-local patches. It would be implemented in the do-patch target > > in bsd.port.mk at the end, after patches from PATCHDIR are applied, > > and patch Makefiles would, by convention, leave it unmolested. > > > > Have I overlooked some better approach to integrating site-local > > fixes? > > I am not aware of any mechanism for this. But I agree that it's > really needed. Before (in cvsup times) we could just place patches > under files/ and be happy, but now when more people use portsnap > we need something better. > > I think making another variable that behaves like EXTRA_PATCHES is > not convenient - you'll have to provide it per-port which means > conditionals in make.conf. > > I think the most convenient way of implementing this is having > a directory hierarchy (either two level ${CATEGORY}/${PORTNAME}/patch-*) > or single level ${PORTNAME}/patch-*) and a single variable that makes > port system look there for patches in addition to ${PATCHDIR}. > > Thus, you only have to add a single line to make.conf: > > USE_LOCALPATCHES= /usr/ports/local-patches > (or /whereever) > > and from there on files will be searced in > > either /usr/ports/local-patches/${CATEGORY}/${PORTNAME} > /usr/ports/local-patches/${PORTNAME}. > > AFAIK, port names are unique in the whole portstree, so single level > layout seems to be easier to handle. > > Here's the draft patch for this functionality: > > http://people.freebsd.org/~amdmi3/local-patchdir.patch How about something like WRKDIRPREFIX? Presumably the logic for dealing with that structure is already in the system. Maybe you could have USE_LOCAL_PATCHES boolean which uses ${CATEGORY}/${PORTNAME}/files subdirs in WRKDIRPREFIX, or LOCALPATCHDIRPREFIX if you want to keep your patches in CVS/SVN without polluting the CVS/SVN working directory. Just a thought. -- Scott Lambert KC5MLE Unix SysAdmin lambert@lambertfam.org