From owner-freebsd-questions@FreeBSD.ORG Tue Mar 23 19:45:58 2010 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 75654106566C for ; Tue, 23 Mar 2010 19:45:58 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (113901-app1.sourcehosting.net [72.32.213.11]) by mx1.freebsd.org (Postfix) with ESMTP id 4CAC08FC18 for ; Tue, 23 Mar 2010 19:45:58 +0000 (UTC) Received: from 68-189-245-235.dhcp.oxfr.ma.charter.com ([68.189.245.235] helo=cube.entropy.prv) by mail1.sourcehosting.net with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1NuA2x-000D7T-5e; Tue, 23 Mar 2010 15:45:56 -0400 Received: from [127.0.0.1] (fireball.entropy.prv [192.168.1.12]) by cube.entropy.prv (Postfix) with ESMTP id 130693D50AD3; Tue, 23 Mar 2010 15:45:51 -0400 (EDT) Message-ID: <4BA91A6B.3030001@FreeBSD.org> Date: Tue, 23 Mar 2010 15:45:47 -0400 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Paul Schmehl References: <20100319170159.GB71392@slackbox.erewhon.net> <20100319200130.GE265@comcast.net> <3D386E86A152519AA850205C@utd65257.utdallas.edu> <8B123BA51B43B4AAC86E0F3C@utd65257.utdallas.edu> <20100319220126.GH265@comcast.net> <2C40431FF3AE42C7B0234A97@utd65257.utdallas.edu> <20100319222143.GI265@comcast.net> <4BA40295.4090006@FreeBSD.org> <83BEEB5783CC06E1C802658D@utd65257.utdallas.edu> In-Reply-To: <83BEEB5783CC06E1C802658D@utd65257.utdallas.edu> X-Enigmail-Version: 0.96.0 OpenPGP: id=1C940290 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.4 (/) Cc: freebsd-questions@freebsd.org Subject: Re: Elegant way to hack port source X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2010 19:45:58 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Paul Schmehl wrote: > --On Friday, March 19, 2010 19:02:45 -0400 Greg Larkin > wrote: >> >> Here's something else that I've found really useful as a port creator, >> maintainer and troubleshooter. If I want to make some additional >> changes to a source file that is patched by a file stored in >> files/patch-...., I'll do this: >> >> make patch # extracts source and patches files >> cd work/foobar/... >> # Now make additional edits in patched file, leaving the >> # .orig file alone >> cd ../back/to/port/directory >> make makepatch >> >> The makepatch target recurses through the work/foobar directory and >> creates diffs for all file.ext/file.ext.orig pairs. It writes them to >> the files/ directory with the patch- prefix on each so the patch target >> processes them. >> >> The only thing to watch out for here, is that makepatch has its own file >> naming convention that doesn't always mirror the port creator's. For >> instance, some ports have patch files named "patch-aa", "patch-ab", etc. >> The makepatch target will recreate them with filenames based on the >> directory and filename of the file to be patched during the build. >> >> Hope that helps, > > Man, does it ever. Thanks for that. > > Which brings me to an obvious question. Where can I go to find out what > all of the make targets are? Is it in /usr/ports/Mk/? > Hi Paul, Yes, that's the first place to look, and there's a lot of documentation about the different variable that control the build process at the top of that file, too. Here's a command that gives a rough list of the available targets: egrep '^[a-zA-Z0-9-]+:$' /usr/ports/Mk/bsd.port.mk | sort -u bsd.port.mk includes various other .mk files depending on what flags are set in the port Makefile, /etc/make.conf and the environment. Hmm, I just found a new target named "update-patches", and I have to go investigate what that does! Regards, Greg - -- Greg Larkin http://www.FreeBSD.org/ - The Power To Serve http://www.sourcehosting.net/ - Ready. Set. Code. http://twitter.com/sourcehosting/ - Follow me, follow you -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFLqRpr0sRouByUApARAskmAJ93A205wIVNU4Mj6IHR7ZxDWFGn8gCfdWch OtQ1c5gbRGeKecdLutJG+JE= =xBkv -----END PGP SIGNATURE-----