You are not logged in.

#1 2008-06-20 17:13:35

osc~
Member
From: brazil
Registered: 2007-07-06
Posts: 117
Website

patches???

hello

does anyone know where i can find some tutorials on how to make patches.
i am making some packages and it is necessary sometimes to know.
cheers
PS
i know nothing of C and C++

Offline

#2 2008-06-20 17:34:42

bangkok_manouel
Member
From: indicates a starting point
Registered: 2005-02-07
Posts: 1,556

Re: patches???

need a patch to fix google on your machine :-P ?
some links

Offline

#3 2008-06-20 18:02:28

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: patches???

diff -u old_source.c new_source.c > lala.patch

or if you want recursive

diff -u -r old_dir/ old_dir/ > lala.patch

Last edited by wonder (2008-06-20 18:06:15)


Give what you have. To someone, it may be better than you dare to think.

Offline

#4 2008-06-20 20:53:35

timetrap
Member
From: Here and There
Registered: 2008-06-05
Posts: 342
Website

Re: patches???

This will create a patch of the differences between file1 and file2

diff -ruN file1 file2 > file.patch

This will patch file1 to be like file2

patch -Np0 < file.patch

Last edited by timetrap (2008-06-20 20:55:25)

Offline

#5 2008-06-20 21:57:37

nj
Member
Registered: 2007-04-06
Posts: 93

Re: patches???

Lately I have been using git for creating patches since it saves me from having to copy the files around.

$ git init
$ git add *.c *.h
$ git commit -m initial
edit files
$ git diff > file.patch

Offline

Board footer

Powered by FluxBB