local patches

Ryan Schmidt ryandesign at macports.org
Sat Sep 4 05:18:47 PDT 2010


On Sep 4, 2010, at 06:57, Björn Lundin wrote:

> the page says:
> %% diff -u src/Makefile.in.orig src/Makefile.in > patch-src-Makefile.in.diff
> 
> but doing so, seems to inverse the patch.
> 
> I copied the original file from xx.cc to xx.cc.orig,
> I changed xx.cc
> I did diff -u xx.cc.orig xx.cc
> 
> but the patch said
> - what I added
> + what I removed
> 
> when I wanted
> + what I added
> - what I removed
> 
> But doing
> diff -u xx.cc xx.cc.orig
> instead did the trick.

I can't confirm this. If "file.orig" is the original file and "file" is the modified file, then the correct command should have been "diff -u file.orig file". See this transcript:


$ echo hello > file
$ cp -p file file.orig
$ echo goodbye > file
$ diff -u file.orig file
--- file.orig	2010-09-04 07:17:42.000000000 -0500
+++ file	2010-09-04 07:17:50.000000000 -0500
@@ -1 +1 @@
-hello
+goodbye
$ 




More information about the macports-users mailing list