6 Submitting patches (or diffs) is the usual way of contributing code to DragonFly BSD. All submissions to the project should go to the submit ["mailing lists"](http://www.dragonflybsd.org/main/forums.cgi) (http://www.dragonflybsd.org/main/forums.cgi). When you submit a patch please include a description of what has been changed.
7 Making patches when you only have a copy of the source:
9 Let's say you just installed DragonFly BSD and you notice a problem in /bin/cat. Since you have /usr/src sync'ed with the main CVS repository. You go into /usr/src/bin/cat and make your modifications. But now what? Well here is what you can do. But next time try the procdure in the next section. :-)
11 1. Copy your version of cat into /usr/src/bin/cat.local
12 2. Run cvsup to resync your source tree back to a clean state.
13 3. Then run diff -ru cat cat.local and submit a patch to the mailing list (with a short description on what you did)
16 root# cp -r /usr/src/bin/cat /usr/src/bin/cat.local
18 root# diff -ru cat cat.local > usr.bin.cat.patch
21 # Making patches when you have a copy of the repository
23 Step 1: Get a copy of the CVS repository
24 Step 2: Check out a copy of the source from that CVS repository
26 Step 4: Generate a patch with cvs diff
31 I use cvsps 1.3.3 to monitor and extract patchsets from the FreeBSD CVS repository. This utility can be found in /usr/pkgsrc/devel/cvsps.
33 **Get a copy of both the FreeBSD and DragonFly cvs repositories.**
35 I use cvsup and the following two files to obtain a partial copy of the two projects (DragonFly and FreeBSD).
41 *default host=cvsup.dragonflybsd.org
42 *default base=/usr/home/okumoto/Work/make
43 *default prefix=/usr/home/okumoto/Work/make/dfly-cvs
45 *default delete use-rel-suffix
53 #*default host=cvsup14.us.FreeBSD.org
55 *default host=cvsup4.us.FreeBSD.org
56 *default base=/usr/home/okumoto/Work/make
57 *default prefix=/usr/home/okumoto/Work/make/fbsd-cvs
59 *default delete use-rel-suffix
65 Execute the following commands:
68 % cd /usr/home/okumoto/Work/make
71 % cvsup fbsd-supfile -c fbsd-sup -i src/usr.bin/make
74 % cvsup dfly-supfile -c dfly-sup -i src/usr.bin/make
77 This should result in two small cvs repositories that only contain source for usr.bin/make, and which will update quickly.
79 Create working directories by checking out the utility you want to work on.
81 The cvs program wants to have a CVSROOT directory so we just create an empty directory. You can use the -R option to cvs, but that prevents you from making your own tags, or checking in stuff into your local repository copy.
84 % mkdir -p fbsd-cvs/src/usr.bin/CVSROOT
86 % (cd fbsd-src; cvs -d ${PWD}/fbsd-cvs/src/usr.bin co make)
88 % mkdir -p dfly-cvs/src/usr.bin/CVSROOT
90 % (cd dfly-src; cvs -d ${PWD}/dfly-cvs/src/usr.bin co make)
93 This should result in a check out of the most current version of make from each project.
94 Use cvsps to extract a change log from the cvs working directory
96 Using cvsps you can extract a patch history.
104 From change log history extract a patch.
107 % cvsps -s 49-50 > patch-XXX
110 ["Patch Set Example"](howtos/PatchSetExample)