From owner-freebsd-questions@FreeBSD.ORG Tue Jan 24 17:50:54 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF1F7106566C for ; Tue, 24 Jan 2012 17:50:54 +0000 (UTC) (envelope-from conrads@cox.net) Received: from eastrmfepo101.cox.net (eastrmfepo101.cox.net [68.230.241.213]) by mx1.freebsd.org (Postfix) with ESMTP id 4AD048FC0A for ; Tue, 24 Jan 2012 17:50:53 +0000 (UTC) Received: from eastrmimpo210.cox.net ([68.230.241.225]) by eastrmfepo101.cox.net (InterMail vM.8.01.04.00 201-2260-137-20101110) with ESMTP id <20120124175046.OPUV24648.eastrmfepo101.cox.net@eastrmimpo210.cox.net>; Tue, 24 Jan 2012 12:50:46 -0500 Received: from serene.no-ip.org ([98.164.86.55]) by eastrmimpo210.cox.net with bizsmtp id RVql1i0091BeFqy02VqlJj; Tue, 24 Jan 2012 12:50:45 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020202.4F1EEF76.0032,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=1.1 cv=LJ9IO+3242BRBuyNVs8xk1samR36zHaHHsCDtW+WEMA= c=1 sm=1 a=j2KJ6Gc3VfkA:10 a=G8Uczd0VNMoA:10 a=kj9zAlcOel0A:10 a=fdHYxQQoAueMHNSmXppgDg==:17 a=PlziWSceAAAA:8 a=WF2pI21SAAAA:8 a=kviXuzpPAAAA:8 a=57rNfspKWNWMo4aim8wA:9 a=Q4Swro95Mtnfi_-nmmcA:7 a=CjuIK1q_8ugA:10 a=x2zDBdn_JSAA:10 a=MHmzl5aOqcYA:10 a=4vB-4DCPJfMA:10 a=fdHYxQQoAueMHNSmXppgDg==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; none Received: from cox.net (localhost [127.0.0.1]) by serene.no-ip.org (8.14.5/8.14.5) with ESMTP id q0OHoijF035947; Tue, 24 Jan 2012 11:50:44 -0600 (CST) (envelope-from conrads@cox.net) Date: Tue, 24 Jan 2012 11:50:39 -0600 From: "Conrad J. Sabatier" To: Maxim Khitrov Message-ID: <20120124115039.7466212b@cox.net> In-Reply-To: References: <4F1DA620.4040207@infracaninophile.co.uk> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Applying local patches after updating FreeBSD source X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 17:50:54 -0000 On Mon, 23 Jan 2012 14:13:49 -0500 Maxim Khitrov wrote: > On Mon, Jan 23, 2012 at 1:25 PM, Matthew Seaman > wrote: > > On 23/01/2012 18:03, Maxim Khitrov wrote: > >> Hi all, > >> > >> When I need to apply a custom patch to a port, I can set > >> EXTRA_PATCHES make variable in /usr/local/etc/ports.conf (when > >> using portconf), and the patch will be automatically applied > >> whenever that port is built. Is there equivalent functionality for > >> building FreeBSD world and kernel? > >> > >> When I run 'make update' in /usr/src, csup overwrites all local > >> changes. There is a LOCAL_PATCHES variable, but it seems to apply > >> only to 'make release'. > >> > >> If possible, I would like to avoid writing custom scripts for > >> updating and building world, because at some point I will forget > >> to use the script and build everything without the patches. How > >> can I preserve the current behavior of running 'make update && > >> make buildworld buildkernel' while automatically applying custom > >> patches in between? > > > > Check the system sources out of svn? > > > > This way, you can apply your patches and the result is automatically > > merged when you update the sources by 'svn up' -- unless there has > > been a conflicting commit to the same file, when you may be > > required to intervene manually. > > I don't have subversion installed on any of my servers and that's a > dependency that I would prefer to do without. > > Are there any changes I could make to /etc/make.conf that would allow > me to execute an arbitrary command after the 'update' task is > finished? My own preferred methodology that I've been using for quite some time now is to use csup to update a local copy of the doc, ports and src areas of the official CVS repository, from which I can then update /usr/{doc,ports,src} via local CVS. This basically has the same perks as what Matthew described for subversion. In my case, I mainly want the flexibility to tinker with ports and not have all of my customizations and patches I'm working on for later submission overwritten with every update. Doing cvs updates will merge my local changes with whatever updates come in from the official repo. Only very rarely will some conflict arise, but as long as you keep an eye on your mail from your cron jobs, it's very easy to spot them and fix them. Having the local CVS repo is especially nice for creating very clean, conforming patches for ports, ready to submit via send-pr, with no worries about any little oddities in the pathnames used to diff the files, since you're diffing against a clone of the actual FreeBSD CVS repo. Of course, everyone has their own tastes when it comes to this sort of thing. I've just been doing it this way for so long now, I'm reluctant to try anything else. Gettin' set in mah ways, I reckon. :-) -- Conrad J. Sabatier conrads@cox.net