Howto apply a patch/diff file

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Howto apply a patch/diff file

Post by CommanderZ »

First: Setup the Visual C++ and necessary dependencies according to the article in wiki. Then try to compile it. Only after you get unmodded OTTD executable, you can try to play with it more and do some changes or apply some pathes.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Howto apply a patch/diff file

Post by Alberth »

Engineer Mars wrote:I do understand that basically all computer data is made up of 0's and 1's. Does anyone suggest a very east patch or diff to try out
No, patches in OpenTTD are source code patches.

You'll need to download the source with a matching revision number of the patch, compile, and try to run it. If that works, apply the patch, compile again, and run it.

Otherwise, wait until somebody uploads a patched binary for you to the forum.
Engineer Mars
Engineer
Engineer
Posts: 37
Joined: 30 Aug 2008 14:31

Re: Howto apply a patch/diff file

Post by Engineer Mars »

Okay tried TortoiseSVN and it not merging anything. I'm using the cargodist patch on page 73.
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Howto apply a patch/diff file

Post by petert »

Engineer Mars wrote:Okay tried TortoiseSVN and it not merging anything. I'm using the cargodist patch on page 73.
TortoiseSVN won't be able to apply CargoDist patches, try the steps from Setting up MinGW to Testing the MinGW installation. Then, open MSYS and type:

Code: Select all

svn co svn://svn.openttd.org/trunk -rXXXX cargodist
Replace XXXXX with a revision number (the revision of the CargoDist patch).
Then, type:

Code: Select all

cd cargodist
Followed by:

Code: Select all

patch -p1 -i <filename>.diff
Then proceed to compile.

If you need some help, I'm on #openttd (OFTC).
Engineer Mars
Engineer
Engineer
Posts: 37
Joined: 30 Aug 2008 14:31

Re: Howto apply a patch/diff file

Post by Engineer Mars »

I just spent 2 hours trying to find the problem for nothing. BEEP!!!!!! Plus I can't chat or I get a BSOD.

EDIT: I get too confused with code.
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Howto apply a patch/diff file

Post by petert »

Engineer Mars wrote:I just spent 2 hours trying to find the problem for nothing. BEEP!!!!!! Plus I can't chat or I get a BSOD.

EDIT: I get too confused with code.
Well, I really can't help you if you're not willing to do some work and follow some instructions. Just download one of my old builds: http://users.tt-forums.net/petert/dev/
Engineer Mars
Engineer
Engineer
Posts: 37
Joined: 30 Aug 2008 14:31

Re: Howto apply a patch/diff file

Post by Engineer Mars »

For 0.7.5 what number is it?
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Howto apply a patch/diff file

Post by petert »

Engineer Mars wrote:For 0.7.5 what number is it?
You cannot play CargoDist on 0.7.5. rXXXXX is the revision number, just pick the latest one (bottom one).

To install, just unzip them to a folder and make sure you have the data files in the shared directory.
User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 314
Joined: 25 Apr 2006 10:22
Location: Bucharest

Re: Howto apply a patch/diff file

Post by ColdIce »

Hy,

I am having trouble applying some patches with TortoiseSVN

the best way to show you I think is a video
http://www.youtube.com/watch?v=n30ZHUCxdYY


I also have this problem with automated-timetables-and-separation-v0.7_trunk_svn_r19152
I used Upgrade aiport patch revision(19171) and still having the problem.
The rest is confetti!
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Howto apply a patch/diff file

Post by petert »

ColdIce wrote:I also have this problem with automated-timetables-and-separation-v0.7_trunk_svn_r19152
I used Upgrade aiport patch revision(19171) and still having the problem.
I'm not sure what happened to the first two patches, you just closed the window without doing anything.

With the last one, you need to Right Click -> Patch All:
http://www.tt-forums.net/viewtopic.php?p=376459#p376459

I'll watch your video again to see if I can understand some more of it.
User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 314
Joined: 25 Apr 2006 10:22
Location: Bucharest

Re: Howto apply a patch/diff file

Post by ColdIce »

I used only 2 patches: upgrade airport and station build GUI
made a new folder OTTD -> right click -> dowloaded last revision
right click on folder->Tortoise->Apply patch->Chosed upgrade airport patch => tortoise opens and nothing happens/shows

then i dragged the patch with right click over the folder, chosed apply patch and still nothing happened. i used the same thing with station build gui to show you that it works with that patch.
The rest is confetti!
Engineer Mars
Engineer
Engineer
Posts: 37
Joined: 30 Aug 2008 14:31

Re: Howto apply a patch/diff file

Post by Engineer Mars »

Yah, I've also tried a couple of patches, and they turn out like that along with my own experiment. Doesn't work at all.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Howto apply a patch/diff file

Post by planetmaker »

Did you ever compile successfully OpenTTD without a patch?

And did you ever consider that other people's crystal ball might be broken, thus they might not figure what technical problem you have besides the articulation problem which transforms all the detailed technical description of what you tried where in what exact sequence into a mere "does not work"? Have you ever considered that such behaviour is annoying, especially keeping to continue this after having asked to provide details in a technical discussion thread like this?
User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 314
Joined: 25 Apr 2006 10:22
Location: Bucharest

Re: Howto apply a patch/diff file

Post by ColdIce »

planetmaker, I hope your post isnt for me :oops:

I dare to ask if someone can spare 5 minutes to apply that patch (upgrade airports) with mingw. I only want an answer if it works or not. i wouldn t dare to ask if mingw was simple for me. It will take ages and many stupid questions for me to learn to work with mingw. I tried once, but i got all mixed up.

here is a link to patch http://www.tt-forums.net/download/file.php?id=124510
The rest is confetti!
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Howto apply a patch/diff file

Post by Yexo »

ColdIce wrote:here is a link to patch http://www.tt-forums.net/download/file.php?id=124510
That patch will work fine with any decent patch program, but it won't work (as you already noticed) with tortoisesvn. If you open the file in a text editor you can see that line 3 and 4 (the lines starting with +++ and ---) both start with "a/" and "b/" before "src/". You need to apply those patches with "patch -p1 < patchname.diff". Tortoisesvn only accepts a very limited subset of patches: those created with svn.
User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 314
Joined: 25 Apr 2006 10:22
Location: Bucharest

Re: Howto apply a patch/diff file

Post by ColdIce »

:lol: "great" news

tonight will be a veeeery long night for me
Learning mingw :shock:

thank you Yexo for your answer
The rest is confetti!
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Howto apply a patch/diff file

Post by planetmaker »

ColdIce wrote:planetmaker, I hope your post isnt for me :oops:
Nah, I wasn't targeting you ;-)
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Howto apply a patch/diff file

Post by petert »

ColdIce wrote::lol: "great" news

tonight will be a veeeery long night for me
Learning mingw :shock:

thank you Yexo for your answer
Good luck, I'm on IRC if you need me or other help. (OFTC, #openttd, nick: PeterT)
fivejc
Engineer
Engineer
Posts: 12
Joined: 22 Sep 2009 08:03

Re: Howto apply a patch/diff file

Post by fivejc »

I have this kind of error when i'm trying to patch files on MinGW. I'm using cargodist.diff file, revision 19289. I think that solution is very simple :evil:
Attachments
Error.JPG
Error.JPG (94.13 KiB) Viewed 4203 times
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2858
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Howto apply a patch/diff file

Post by ChillCore »

Could it be that you have not checked out the correct revision of the source before trying to patch?
When a diff/patch is made it is done so against the revision the creator had installed at that moment.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 19 guests