In the preparation of the port, files that have been added or changed can be picked up
with a recursive diff(1) for later
feeding to patch(1). Each set of
patches you wish to apply should be collected into a file named patch-* where * denotes the sequence in which the patches will be applied --
these are done in alphabetical
order, thus aa first, ab
second and so on. If you wish, you can use names that indicate the pathnames of the files
that are patched, such as patch-Imakefile or patch-src-config.h. These files should be stored in PATCHDIR, from where they will be automatically applied. All patches
should be relative to WRKSRC (generally the directory your
port's tarball unpacks itself into, that being where the build is done). To make fixes
and upgrades easier, you should avoid having more than one patch fix the same file (e.g.,
patch-aa and patch-ab both changing
WRKSRC/foobar.c).
Do not put RCS strings in patches. CVS will mangle them when we put the files into the
ports tree, and when we check them out again, they will come out different and the patch
will fail. RCS strings are surrounded by dollar ($) signs, and
typically start with $Id or $RCS.
Using the recurse (-r) option to diff(1) to generate
patches is fine, but please take a look at the resulting patches to make sure you do not
have any unnecessary junk in there. In particular, diffs between two backup files, Makefiles when the port uses Imake or GNU
configure, etc., are unnecessary and should be deleted. If you
had to edit configure.in and run autoconf to regenerate configure, do not
take the diffs of configure (it often grows to a few thousand
lines!); define USE_AUTOCONF_VER=213 and take the diffs of configure.in.
Also, if you had to delete a file, then you can do it in the post-extract target rather than as part of the patch. Once you
are happy with the resulting diff, please split it up into one source file per patch
file.