1 |
$Id: PATCH-HOWTO,v 1.15 2011/02/13 14:19:32 simple Exp $ |
2 |
|
3 |
Patch Howto |
4 |
Last revised: July 23, 2004 |
5 |
_____________________________________________________________________ |
6 |
|
7 |
Patch Howto |
8 |
|
9 |
|
10 |
The purpose of this document is to show you what a patch is and how you |
11 |
can create, apply, download, and submit a patch. |
12 |
|
13 |
Contents: |
14 |
1. Terms |
15 |
2. Applying a patch |
16 |
3. Creating and submitting a patch |
17 |
4. Downloading a patch |
18 |
|
19 |
|
20 |
1. Terms |
21 |
|
22 |
The following are some common terms used in this document: |
23 |
|
24 |
Patch |
25 |
A patch is an update to the source code of a program (here Eggdrop). |
26 |
Be careful, every patch is designed for a special Eggdrop version |
27 |
and cannot be applied on every bot! |
28 |
|
29 |
|
30 |
2. Applying a patch |
31 |
|
32 |
To apply a patch to an Eggdrop, you have to first obtain the Eggdrop |
33 |
source code. You should always keep a tar.gz archive with the source of |
34 |
your current Eggdrop on your shell. In the next step, you have to change |
35 |
to your source directory (i.e.: /home/user/eggdrop1.6.21/) and type |
36 |
the following command: |
37 |
|
38 |
patch -p1 < ../path.to.the/patch |
39 |
|
40 |
Once this is complete, execute the following command: |
41 |
|
42 |
find . -name "*.rej" -print |
43 |
|
44 |
If it returns a list with filenames ending with .rej extension, then the |
45 |
patch didn't apply properly. Ensure that the patch is intended for your |
46 |
version and that you have the original source. You should also try to |
47 |
re-download the patch to ensure that the patch is not corrupted. |
48 |
|
49 |
If you get an error such as this: |
50 |
|
51 |
|Index: Makefile.in |
52 |
|=================================================================== |
53 |
|RCS file: /usr/local/cvsroot/eggdrop1.6/Makefile.in,v |
54 |
|retrieving revision 1.38 |
55 |
|diff -u -r1.38 Makefile.in |
56 |
|--- Makefile.in 17 Jun 2004 05:43:28 -0000 1.38 |
57 |
|+++ Makefile.in 23 Jul 2004 21:58:23 -0000 |
58 |
-------------------------- |
59 |
File to patch: |
60 |
|
61 |
Then you should try using a different '-p' option. Try -p0 first, and then |
62 |
-p2, -p3, etc. |
63 |
|
64 |
|
65 |
If the patch applied properly, the only thing left to do is to recompile |
66 |
your Eggdrop and install the new modules and binaries. |
67 |
|
68 |
|
69 |
3. Creating and submitting a patch |
70 |
|
71 |
If you fixed a bug and/or changed something in Eggdrop's source code, it |
72 |
would be really nice to let the dev team know about it, so we can |
73 |
possibly apply it to next release of Eggdrop. |
74 |
|
75 |
There are several steps to submit a patch to the eggdev team: |
76 |
|
77 |
1. Create a directory with original source tree and one with modified |
78 |
source tree. |
79 |
|
80 |
2. Run the following: |
81 |
|
82 |
diff -urN eggdrop1.6.original eggdrop1.6.modified > patchname.patch |
83 |
|
84 |
DO NOT add any other diff options. |
85 |
|
86 |
3. Send an e-mail to patches@eggheads.org with the patch attached. The |
87 |
body should contain a detailed description of what you changed and |
88 |
why you changed it. Don't forget to include the Eggdrop version for |
89 |
which your patch was created. |
90 |
|
91 |
It helps if you include the major release number that the patch is |
92 |
for in the subject line. For the 1.6.x series, the subject line |
93 |
should look like this: |
94 |
|
95 |
PATCH1.6: my-patch-filename.patch |
96 |
|
97 |
You should also include the nick/handle, name, and email address |
98 |
you would like used for attribution in the Changes1.6 and THANKS |
99 |
files. |
100 |
|
101 |
Never modify src/patch.h or one of the Changes files. We will do it. If |
102 |
your patch includes changes related to autotools (./configure, etc), do |
103 |
NOT run autoconf, autoheader, etc; we will do this as well. |
104 |
|
105 |
Also, please don't add credit lines all over the source when patching. |
106 |
Patch contributors will receive credit in Changes1.6 and THANKS. |
107 |
|
108 |
CVS diff's are also perfectly fine (and actually, prefered, as the patch |
109 |
will be against the most current version of Eggdrop). To create a CVS |
110 |
diff, simply make the changes in your currently checked-out copy of the |
111 |
Eggdrop source, and then run: |
112 |
|
113 |
cvs diff -R -uN > patchname.patch |
114 |
|
115 |
|
116 |
4. Downloading a patch |
117 |
|
118 |
Many patches for Eggdrop 1.6.x can be found at the following location: |
119 |
|
120 |
ftp://ftp.eggheads.org/pub/eggdrop/patches/1.6 |
121 |
_____________________________________________________________________ |
122 |
|
123 |
Copyright (C) 1999 - 2011 Eggheads Development Team |