Modifying a port and keeping the mods across updates

Wesley Shields wxs at
Sat Jan 20 15:35:45 UTC 2007

On Fri, Jan 19, 2007 at 11:37:59PM -0600, Scot Hetzel wrote:
> On 1/19/07, Paul Hoffman <phoffman at> wrote:


> >(2) For a particular port, I need to patch a particular source file.
> >This is a patch that will probably be in a future release. Same
> >question as above: what's the proper way to do this that will live
> >beyond the next cvsup? I know how to use 'patch' to apply patches,
> >but not yet to create them.
> >
> To create a patch you first need to create a backup of the original
> file, then create the diff.
> cp file.c file.c-orig
> <make changes to file.c
> diff -u file.c-orig file.c > patch-file.c
> Then place the patch file into /usr/ports/<category>/<portname>/files.

There is a makepatch target which will do the diff and place the output
in the appropriate place for you.  I stumbled across this a few weeks
ago and it has already proved to be useful to me.  :)

-- WXS

More information about the freebsd-ports mailing list