Re: [Circle] [Newbie] Patching

From: Dana Luther (dtluther@mindspring.com)
Date: 05/23/00


>Can somebody please explain the process of manualy patching the circle
>source using the information
>provided by a .patch file ?


In the patch file, you'll see a set of lines similar to the following:

diff -uprN -x *.o ../../src/db.c ./db.c
--- ../../src/db.c Sun Mar 28 07:03:59 1999
+++ ./db.c Sun Mar 28 05:01:15 1999

This is telling you which file it is that the next series of changes
 needs to be made to (and where it's coming from). In this case
it is db.c, so back up your db.c if you haven't already and open it
up for editing.

Under that, you will see a line similar to the following:

@@ -2722,6 +2723,12 @@ int read_xap_objects(FILE *fl,struct cha

This is telling you what line the change needs to be made at
(assuming you have the same source file as the patch is using).
Usually it's not quite the same, but it can get you to the ballpark.,
so go to line 2722 and look around there for the function listed
after the second @@ (in this case, read_xap_objects) to make
sure you're in the right place.

Then depending on how the patch was made, you'll have 2 or
 three options telling you what to do.
At the beginning of the line to edit, you'll see a + or a - (or a !)

If the patch is made with only the +/- options (my personal pref,
just because it's easier to hand patch) then you'll see something
like the following:

     int var1, var2, var3;
-    int var4;
-   char a, b, c;
+  char a, b, c, d;
+  char e;
    struct char_data *vict;

Assume your original looks like this:
     int var1, var2, var3;
     int var4;
    char a, b, c;
    struct char_data *vict;

You'd simply delete the lines from your file that are prefaced with
the -, and add the lines with the + , giving you something like this
after patching:

     int var1, var2, var3;
    char a, b, c, d;
    char e;
    struct char_data *vict;



If you have the ! symbols then you'll have two sections for each
change.
The first instance showing you what the original line looked like
and noting any needed alterations to those and the lower instance
showing you what it should look like after its been altered.
It would be something like the following:


     int var1, var2, var3;
-    int var4;
!   char a, b, c;
    struct char_data *vict;

-----

     int var1, var2, var3;
!   char a, b, c, d;
+  char e;
    struct char_data *vict;

Keep going in that file till you see the next

diff -uprN -x *.o ../../src/interpreter.c ./interpreter.c
--- ../../src/interpreter.c Sun Mar 28 07:03:59 1999
+++ ./interpreter.c Sun Mar 28 05:01:15 1999

then switch to that file (again, as always make sure you have a backup copy)
and keep going.

I hope that made sense.

Dana


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT