[Dev] Questions about patch?

Xinghua Shi dev@trilug.org
Thu, 1 May 2003 13:48:25 -0500 (CDT)


Hey,James

  I saw your posts about how to create a patch using cvs and then do
patch. This is what I wanna do in my project(On Solaris), but I got some
problem here and couldn't figure out how to deal with this.
  Thanks for any hints. :-)

What I did is like:
1.create the patch using cvs
  cvs diff -c orbit.c > original_diff

2.original_diff looks like:

Index: orbit.c
===================================================================
RCS file: /u1/shi/cvs/Orbit/orbit.c,v
retrieving revision 1.7
diff -c -r1.7 orbit.c
*** orbit.c	28 Apr 2003 18:37:30 -0000	1.7
--- orbit.c	30 Apr 2003 18:02:16 -0000
***************
*** 1,5 ****

! char cvsroot_orbit_c[] = "$Header: /u1/shi/cvs/Orbit/orbit.c,v 1.7
2003/04/28 18:37:30 shi Exp $";

  #include <stdio.h>
  #include <stdlib.h>     /* for exit() prototype */
--- 1,5 ----

! char cvsroot_orbit_c[] = "$Header: /u1/shi/cvs/Orbit/orbit2.c,v 1.4
2003/04/22 18:44:30 shi Exp $";

  #include <stdio.h>
  #include <stdlib.h>     /* for exit() prototype */
***************
*** 194,199 ****
--- 194,202 ----
    /*
      this is still a test.
     */
+
+   printf("Blah,blah,this is my test!\n");
+

    fp = fopen("sim.out","w");
    printf("Running. Result in 'sim.out'\n");


3. do the patch
   patch -c -i original_diff orbit.c

But it complains:

Looks like a new-style context diff.
done

But nothing was done with the file orbit.c. Not any patching happened.

Actually, I don't know where to ask this question. So any suggestions are
heartly appreciated. :-)

Good day!


BR
-Mindy