You are not logged in.
Hello,
I have a source tree and a diff file containing about 200 changes to different files in the source tree.
In the past I only applied changes to a source tree using patch files, but how do i do this with a diff file?
I tried stuff like patch srctree -n updates.diff, but that fails ...
Do i have to create a patch file out of the diff file? Cause i saw that it seems to be the normal case that you create
patch files using two different source trees and than compare them using diff.
Thank you!
Offline
The terms "diff file" and "patch file" are equivalent. patch can read various formats generated by a diff program.
Have you simply tried the following (you may need the -p option)?
patch < updates.diffOffline
The only thing different should be the extension, and Linux doesn't care about that.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Hi!
thx for the help!
If i run patch < file.diff i get " patch: **** Only garbage was found in the patch input. "
So i assumed the file has no valid format. The head of the file looks like that.
diff -rN old-ion-3plus-1/README new-ion-3plus/README
125a126,128
> The code in `de/unicode' (producing `de/precompose.c') is taken from
> xterm.
>
diff -rN old-ion-3plus-1/build/rules.mk new-ion-3plus/build/rules.mk
126a127,128
> DEFINES += -DCF_EXECUTABLE=\"$(EXECUTABLE)\"
>
141c143
< CC_PICFLAGS=-fPIC -DPIC
---
> #CC_PICFLAGS=-fPIC -DPIC
diff -rN old-ion-3plus-1/config.h new-ion-3plus/config.h
32a33,35
> #define CF_USERTIME_DIFF_CURRENT 2000
> #define CF_USERTIME_DIFF_NEW 4000
>
diff -rN old-ion-3plus-1/de/Makefile new-ion-3plus/de/Makefile
14c14
< SOURCES=init.c draw.c font.c colour.c brush.c fontset.c style.c
---
> SOURCES=init.c draw.c font.c colour.c brush.c fontset.c style.c precompose.c
diff -rN old-ion-3plus-1/de/font.c new-ion-3plus/de/foShould i be able to use this with patch?
Offline
Try
$ patch -Np1 -i updates.diffAnd read the manual:
$ man patchThe diff -rN command you see in between the snippets to be removed or added is the command used to generate the patch btw.
Last edited by .:B:. (2011-09-18 13:51:39)
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Hi!
should patch -i file.diff, interpret diff statments in the diff file?
Sadly patch still failes with complaining about garbage input ...
Offline