How does one apply a patch?

Non release banter
User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

How does one apply a patch?

Post#1 by francois » 23 Jul 2011, 01:03

I am trying to apply a patch needed in the compilation of a package:
http://forum.porteus.org/viewtopic.php?f=81&t=704

I have googled a little and found patch(1) - Linux man page:
http://linux.die.net/man/1/patch
and found a thread:
http://www.linuxquestions.org/questions ... ost4422822

I still am lost in the clouds.

What is the usual format for a patch? Text file, bash file ...
How does one apply the patch command and where should be the patch located in reference to the package to be patched?
Last edited by francois on 23 Jul 2011, 10:11, edited 1 time in total.
Prendre son temps, profiter de celui qui passe.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: How doe one apply a patch?

Post#2 by Ahau » 23 Jul 2011, 02:30

Patches are plain text. Put the plain text file, patchfile (or whatever you like) in the root directory of the source you're compiling, then:

patch -p1 < patchfile

That's unfortunately the extent of my knowledge. I'm still struggling with patches as well ;)
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: How does one apply a patch?

Post#3 by francois » 23 Jul 2011, 10:57

Thanks Ahau.
Prendre son temps, profiter de celui qui passe.

Post Reply