1 (edited by xavierp94 2010-08-11 23:46:45)

Topic: [SOLVED] Patching Files in Linux?

I've been wondering for a while how I could use the patch file mod makers provide for patching the source code for teeworlds. How or what command do I have execute to make this happen? I'm running Linux Mint btw.

2

Re: [SOLVED] Patching Files in Linux?

What do you mean? Do you want to make a patch or to use a patch?

To use a patch:
Download GNU Patch Binary and use it like this: ".\patch -p0 < patchfilename.patch" in the terminal.

To creat a patchfile:
Download the GNU Diffutils and use them like this: ".\diff -rupN sourcepath newpath > patchfilename.patch"
For Sourcepatch you normally use the stadart Teewords Src and for newpath you mods src.
Make sure that there is the same folder struct or the patch will get to big.
And remove the files in src/game/generated as the will be generated later.
And only patch the "src" folder, in case you did not change anything out of it.

3

Re: [SOLVED] Patching Files in Linux?

KillaBilla wrote:

.\patch -p0 < patchfilename.patch

KillaBilla wrote:

.\diff -rupN sourcepath newpath > patchfilename.patch

Should be:
patch -p0 < patchfilename.patch
diff -rupN sourcepath newpath > patchfilename.patch

4 (edited by xavierp94 2010-08-09 17:32:54)

Re: [SOLVED] Patching Files in Linux?

Ok thanks guys for the help. I have another question though, it it possible to patch the teeworlds source code with different patches to add functionality to the source? What I want to do is add several patches to customize my version of Teeworlds to have only things that I need?

5

Re: [SOLVED] Patching Files in Linux?

That is different from patch to patch. Usually it works.

6

Re: [SOLVED] Patching Files in Linux?

Kottizen wrote:

That is different from patch to patch. Usually it works.

I have a problem with a patch. I have used the friendslist patch on the source code for teeworlds. Everything went well. Then I decided that Killa Billa's patch for Download Extension was another thing that I need so I tried to use that on my already patched teeworlds with the friendslist functionality. I no longer can add any more patches. How do I fix this? Thanks for the help in advance!

7

Re: [SOLVED] Patching Files in Linux?

You can't fix: in a patchfile there is written in which line in the file something has to be removed or added.
But if there stands something else in the Headerline the patch can't be used.

To do it: Patch another clean source and add everything in this source to yous, that's much work but if you really want to do it. wink

8

Re: [SOLVED] Patching Files in Linux?

xavierp94 wrote:
Kottizen wrote:

That is different from patch to patch. Usually it works.

I have a problem with a patch. I have used the friendslist patch on the source code for teeworlds. Everything went well. Then I decided that Killa Billa's patch for Download Extension was another thing that I need so I tried to use that on my already patched teeworlds with the friendslist functionality. I no longer can add any more patches. How do I fix this? Thanks for the help in advance!

You can patch it by hand. Take a clean source and patch it with your friend's patch. Then, open KillaBilla's patch in a text editor and read it, from the start to the end.

The most lines have a "+" or a "-". A plus means "add" and a minus means "remove". Some lines also contain information about which file that those lines are on. So, first, open the first stated file and copy over all pluslines, don't forget to remove the plus-marks. Then, look for the minuslines, if any, and remove them.

If you do so throw the whole patchfile, it should work, but I can't guarantee is works.

9

Re: [SOLVED] Patching Files in Linux?

Thanks!