On Fri, 28 Nov 2008, Talha Yalta wrote:
> Talha: try applying the following patch; would you be happy with
> Allin: are there any undesirable side-effects with this patch I haven't
> thought of?
Thanks very much but how do I apply it? I have never done this before.
Crash course in diff unified format:
RCS file: /cvsroot/gretl/gretl/gui2/gpt_dialog.c,v
retrieving revision 1.109
diff -u -r1.109 gpt_dialog.c
--- gui2/gpt_dialog.c 21 Nov 2008 21:56:51 -0000 1.109
+++ gui2/gpt_dialog.c 27 Nov 2008 23:11:11 -0000
@@ -1926,6 +1926,7 @@
stylist = g_list_append(stylist, "impulses");
stylist = g_list_append(stylist, "dots");
stylist = g_list_append(stylist, "steps");
+ stylist = g_list_append(stylist, "boxes");
vbox = gp_dialog_vbox();
The above is called a patch. It tells you that the file that needs
modifications in the gretl source tree is "gui2/gpt_dialog.c" (it says so
on top). In this case, the only modification is to add the line
stylist = g_list_append(stylist, "boxes");
"Adding" is where the "+" in the patch comes from. If there had been
lines to delete from the source, you'd have had a minus sign.
You can find the exact point in the source where to do add the line by
looking for "@@". In this case, the patch shows you the point where the
adding goes by surrounding it with a few context lines. The first line
you're shown is line 1926.
So, in practice you may apply the patch by
- making sure your source tree is up to date
- opening the file gui2/gpt_dialog.c with any editor you like
- navigating to line 1926
- adding the appropriate line into the appropriate place
- building gretl as per usual
On a unix system, most of these steps can be automated via a utility
called "patch". See "man patch" for details.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche