Page 34 of 40

Re: Howto apply a patch/diff file

Posted: 08 Oct 2010 10:02
by Alestorm
Hi, after long work i've finally managed to apply a patch using TortoiseSVN/Merge. I'm able to patch all the files without any problems. But now, i still have the problem how to actually play the game.
When I save the file when i have patched it and then try to play the game... nothing has changed.

If someone could help me with that I'd be very gratefull :)

Re: Howto apply a patch/diff file

Posted: 08 Oct 2010 10:07
by dihedral
the additional keyword you are looking for is 'compile' or 'compiling' - using this keyword in the tt-forums search function, or that of wiki.openttd.org will lead you to some lovely additional information :-)

Re: Howto apply a patch/diff file

Posted: 08 Oct 2010 10:25
by Alestorm
Thanks, but it doesn't really help me.

I've done everything it says on the Wiki. Which did nothing with the patch I've downloaded.
For that information I went to this topic. Read that windows should use TortioseSVN, so I did.
But in the explanation it says how to apply the patch, but not what to do afterwards.

All those different programms are getting me a little confused.haha.

Re: Howto apply a patch/diff file

Posted: 08 Oct 2010 10:30
by dihedral
after applying the patch you need to follow the steps on the wiki and compile.
you have the source code, you have patched the source code - now you need a binary, for that the source code must be compiled and you will in the end receive the openttd.exe in the bin/ directory of the source code you already have.

Re: Howto apply a patch/diff file

Posted: 07 Apr 2011 12:50
by Simoneq
Please have a question. I may install this patch
http://www.tt-forums.net/viewtopic.php?f=33&t=33137 but I do not know how to please simple instructions. I have no idea how to apply the patch. My English is bad simply because the very simple instructions.

How do I install a patch

Posted: 02 May 2011 16:21
by beker60
I have been looking on the forums and found patches that I would like to test. (example: the copy&paste patch, ProgSigs). They come in diff files.
I don't know wath I must do to install the patches. I think I need to compile the game using the patches. But i'm not sure and I don't know how I will need to do this.

Thanks.

Re: Howto apply a patch/diff file

Posted: 02 May 2011 16:30
by planetmaker
You might have found this sticky... yes, you'll need to compile OpenTTD's source code. Also see the wiki for that.

Re: Howto apply a patch/diff file

Posted: 17 Jun 2011 06:28
by DragDen
Greetings everyone.
I have a question - to apply multiple patches intended for different revisions, is this the correct way?

Code: Select all

svn update -r 16200
patch -p0 < company_info_v3_r16200.patch
svn update -r 19990
patch -p0 < buy_area_r19990.diff
svn update -r 20180
patch -p0 < more-cond-orders.r20180.patch
Or updating to new version overwrites previously applied patches?

And is there a way to revert partially applied patch (which resulted in error)? Because

Code: Select all

svn revert -r <name>
just says "Skipped <name>"

Re: Howto apply a patch/diff file

Posted: 17 Jun 2011 11:54
by Yexo
Generally yes, that is the correct way. However each "svn update -r x" after applying a patch might give trouble. In that case you'll have to fix the problems manually in the source code.

If you apply patches like this there is no way to revert things only partly. If you know the patch only changes files src/a.cpp and src/b.cpp and no other patch changed those you can run "svn revert src/a.cpp src/b.cpp". If other patches modified those files too you're out of luck.

Re:

Posted: 09 Jul 2011 11:36
by Loiner
MeusH wrote:If you're using windows, you can download TortoiseSVN, install and do the following:

Download the source files:
Make a new folder
Right click on it
Choose "SVN Checout..." from the menu
Set data fields like on attachement 1
Hit OK, wait 5-20 minutes for all files to download

Choose the diff file:
Right click on folder you've downloaded files to
Choose "TortoiseSVN > Apply Patch..." from the menu
Browse for .patch or .diff file

Apply the changes:
Usually, right clicking on filelist window (attachement 2) and clicking "Patch all" should work, but sometimes there is something wrong (attachement 2 - files marked red):

Don't worry, often application will download other revision and everything will work.
However, if you're experiencing problems (marked red) ask patch developer and tell him what's wrong. Tell him what diff file have you downloaded and what revision have you downloaded using "SVN Checkout"


Happy patching :)
I tried doing this with the infrastructure sharing patch but it's not worked...I probably did something wrong though.

What is the easiest method of patching, for someone who is completely inexperienced with this sort of thing? :)

Re: Howto apply a patch/diff file

Posted: 09 Jul 2011 11:58
by Alberth
That quoted text comes quite close, except that after download you should not apply any patch, but instead first build a binary from unmodified trunk sources.
That exercises the whole compiler chain, and if the built binary works, you know that parts works.

Then if you apply a patch and it breaks, you know that patching is the problem spot.


As for further assistance, we need more details than "I did something wrong."

Re: Howto apply a patch/diff file

Posted: 09 Jul 2011 12:42
by Loiner
Alberth wrote:That quoted text comes quite close, except that after download you should not apply any patch, but instead first build a binary from unmodified trunk sources.
That exercises the whole compiler chain, and if the built binary works, you know that parts works.

Then if you apply a patch and it breaks, you know that patching is the problem spot.


As for further assistance, we need more details than "I did something wrong."
I don't know if I did, I followed everything in the quoted text but hasn't gone through so I assume I've missed something out.

Like I say, I'm completely new to this and there's just one patch I want to install, so what would be an easy method for a patching rookie like me to understand? :) How would I go about building a binary from trunk sources to install this patch?

Re: Howto apply a patch/diff file

Posted: 09 Jul 2011 14:13
by Alberth
Read the wiki about downloading SVN source, installing compilers, building the binary.
You may want to join IRC, as explaining it here is way too complicated.

(Also, as I don't have Windows, I am probably not the best person to ask how to do it, others may be in a better position to help you.)

Re: Howto apply a patch/diff file

Posted: 11 Jul 2011 16:41
by Loiner
I've just had a look through and it's all too complicated for me. :|

Doesn't TortoiseSVN do the whole thing for you? I've applied the patches, I just need to know how to get them to work.

Re: Howto apply a patch/diff file

Posted: 11 Jul 2011 16:45
by planetmaker
TortoiseSVN is only the tool which helps to apply patches to the source code. Which is the very first step.

But as others have said before: first compile without patches so that you confidently can say that you can build OpenTTD. Only if that succeeds it's worth to continue, and compile a patched OpenTTD.

Re: Howto apply a patch/diff file

Posted: 11 Jul 2011 16:52
by Loiner
OK, well I've got BuildOTTD and I've followed the instructions on the Wiki but I'm unable to click 'Update and Compile'. Any ideas?

(Apologies if my n00bishness is getting annoying :wink: )

Re: Howto apply a patch/diff file

Posted: 11 Jul 2011 16:54
by FooBar
What operating system? I believe BuildOTTD doesn't work on Vista or Win7, unless that changed since the last time I checked.

Re: Howto apply a patch/diff file

Posted: 11 Jul 2011 16:55
by Loiner
I'm on Win7, so that must explain a lot.

What is the easiest method of compiling OpenTTD?

Re: Howto apply a patch/diff file

Posted: 11 Jul 2011 17:08
by Lord Aro
http://wiki.openttd.org/Category:Compiling_OpenTTD

those are about your only options

Re: Howto apply a patch/diff file

Posted: 11 Jul 2011 17:32
by Loiner
So if I used this method:

http://wiki.openttd.org/Compiler_sur_MinGW/Fr

Would I have to do everything mentioned or just the part under 'Compiling OTTD'?

Also, is there something I should put where it says 'cd ~/<path_to_source>'?