Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Mar 2010 19:02:45 -0400
From:      Greg Larkin <glarkin@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Cc:        Paul Schmehl <pschmehl_lists@tx.rr.com>, "corky1951@comcast.net >> Charlie Kester" <corky1951@comcast.net>
Subject:   Re: Elegant way to hack port source
Message-ID:  <4BA40295.4090006@FreeBSD.org>
In-Reply-To: <20100319222143.GI265@comcast.net>
References:  <a14066a01003190935t4bbef41esc44c60a5b00e6144@mail.gmail.com>	<20100319170159.GB71392@slackbox.erewhon.net>	<20100319200130.GE265@comcast.net>	<3D386E86A152519AA850205C@utd65257.utdallas.edu>	<a14066a01003191404u56fd3f71mbfacff83839b7a2c@mail.gmail.com>	<8B123BA51B43B4AAC86E0F3C@utd65257.utdallas.edu>	<20100319220126.GH265@comcast.net>	<2C40431FF3AE42C7B0234A97@utd65257.utdallas.edu> <20100319222143.GI265@comcast.net>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Charlie Kester wrote:
> On Fri 19 Mar 2010 at 15:07:44 PDT Paul Schmehl wrote:
>> --On Friday, March 19, 2010 15:01:27 -0700 Charlie Kester
>> <corky1951@comcast.net> wrote:
>>>
>>> Again, no need for the separate 'make extract' step.
>>> In fact, I'd go straight to 'make build' or 'make install' here, and
>>> skip the separate 'make patch' too.
>>>
>>
>> Thanks, Charles.  You taught me something today. :-)
> 
> You're welcome.  We're here to help.  :)
> 
> The main point I wanted to make was to run "make patch" BEFORE
> editing the port's sourcecode, so you don't lose the work done by
> the maintainer
> 
> And you would lose that if you simply did "make extract" and then
> started hacking on the result.  Or, what amounts to the same thing, if
> you grabbed the distfile and unzipped it into your home directory or
> somewhere.

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,
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/

iD8DBQFLpAKV0sRouByUApARAjBOAJwLRfrND7Jky6egSVDkSuRiUdiOiACgqglr
cGhgsIvFPnXzOMdVTAxWhOM=
=T5+p
-----END PGP SIGNATURE-----




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BA40295.4090006>