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

mathijsjansen
Engineer
Engineer
Posts: 5
Joined: 25 Jun 2007 23:24

Problem installing patch

Post by mathijsjansen »

I've just discovered openTTD recently and like it really much, but I've got one problem, oil refineries can only be build close to the edge (while using fund new industry). For large maps, this is insane. Now I've found a .diff file to solve this problem, but I cannot instal it.

I am a total noob when it comes to installing patches for openTTD, so I followed the instructions given by MeusH. When I follow this method I get the message that there are unresolved conflicts. I tried to solve them by indicating which version (theirs or mine in SVNTortoise) I prefer.
Now I think I did it right, but still it doesn't work in openTTD. Is there some final step which should be made, because I can't inmagine how openTTD knows that it should check this new made folder. Is there a way to update the instal files used by openTTD

Thanks, Mathijs Jansen
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 710
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can...

Re: Problem installing patch

Post by Digitalfox »

mathijsjansen wrote:I've just discovered openTTD recently and like it really much, but I've got one problem, oil refineries can only be build close to the edge (while using fund new industry). For large maps, this is insane. Now I've found a .diff file to solve this problem, but I cannot instal it.

I am a total noob when it comes to installing patches for openTTD, so I followed the instructions given by MeusH. When I follow this method I get the message that there are unresolved conflicts. I tried to solve them by indicating which version (theirs or mine in SVNTortoise) I prefer.
Now I think I did it right, but still it doesn't work in openTTD. Is there some final step which should be made, because I can't inmagine how openTTD knows that it should check this new made folder. Is there a way to update the instal files used by openTTD

Thanks, Mathijs Jansen
Have you tried with this:

BuildOTTD

http://www.tt-forums.net/viewtopic.php?t=31823&start=0
mathijsjansen
Engineer
Engineer
Posts: 5
Joined: 25 Jun 2007 23:24

Post by mathijsjansen »

I've tried this program and it works easily, but when I try to patch openTTD I get the following error message:

can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: industry_cmd.c
|===================================================================
|--- industry_cmd.c (revision 1787)
|+++ industry_cmd.c (working copy)
--------------------------
No file to patch. Skipping patch.
1 out of 1 hunk ignored



I got the patch from:
http://sourceforge.net/tracker/index.ph ... tid=636367

Thanks, Mathijs
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Probably you are applying the patch in the wrong directory

What's the output of:

Code: Select all

$ ls industry_cmd.c
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 623
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Post by glx »

DaleStan wrote:Probably you are applying the patch in the wrong directory
Or the wrong revision (r1787 is very very old)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Ah. Yes. That could be a problem too.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Mattastic
Engineer
Engineer
Posts: 5
Joined: 20 Jul 2007 16:44

Re: Howto apply a patch/diff file

Post by Mattastic »

I just can't figure this out. I can't use TortoiseSVN (something about not having the right version to install it with or something) and every other SVN thing seems impossible to work out. Tutorials aren't helpful, because they're written by people who know how to use it and expect everyone else to know what they're talking about. And typing that code in the console doesn't seem to work at all. In fact, whether the patch I'm trying to install exists or not (I tried with non-existant ones just to see) I get this message:

Code: Select all

- Change patch variables for all players. Usage: 'patch <name> [<value>]'
- Omitting <value> will print out the current value of the patch-setting.
And then nothing happens. In fact, I even get that message if I just type "patch". So I tried the following:

Code: Select all

patch filename.patch [-p0]
No meaningless message there, but still, no working patch. So then I tried to see if the second line of that message was true and tried:

Code: Select all

patch filename.patch
Turns out that...

Code: Select all

'filename.patch' is an unknown patch setting.
Isn't that nice. Do I just have my .patch file in the wrong folder? I put it in the root of my OTTD installation.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Howto apply a patch/diff file

Post by Bilbo »

Mattastic wrote:I just can't figure this out. I can't use TortoiseSVN (something about not having the right version to install it with or something) and every other SVN thing seems impossible to work out. Tutorials aren't helpful, because they're written by people who know how to use it and expect everyone else to know what they're talking about. And typing that code in the console doesn't seem to work at all. In fact, whether the patch I'm trying to install exists or not (I tried with non-existant ones just to see) I get this message:

Code: Select all

- Change patch variables for all players. Usage: 'patch <name> [<value>]'
- Omitting <value> will print out the current value of the patch-setting.
And then nothing happens. In fact, I even get that message if I just type "patch". So I tried the following:

Code: Select all

patch filename.patch [-p0]
No meaningless message there, but still, no working patch. So then I tried to see if the second line of that message was true and tried:

Code: Select all

patch filename.patch
Turns out that...

Code: Select all

'filename.patch' is an unknown patch setting.
Isn't that nice. Do I just have my .patch file in the wrong folder? I put it in the root of my OTTD installation.
You have wrong "patch.exe" binary.

First, the correct syntax is "patch -p0 <filename.patch"

Second - you need to get different patch frogram. Rename patch.exe to something else, then get MSYS from http://www.mingw.org/download.shtml#hdr8 - it includes the correct patch you need
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Mattastic
Engineer
Engineer
Posts: 5
Joined: 20 Jul 2007 16:44

Re: Howto apply a patch/diff file

Post by Mattastic »

Well, I never had a patch.exe anyway. No such file comes with OTTD. But I got MSYS and copied over the patch.exe from that. Since I didn't have any reference as to where it goes, I placed it under my root OTTD folder. However, the same problems persist. :?
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Howto apply a patch/diff file

Post by Rubidium »

Looks to my as if you are running patch from the OpenTTD console. Am I right about that?
Mattastic
Engineer
Engineer
Posts: 5
Joined: 20 Jul 2007 16:44

Re: Howto apply a patch/diff file

Post by Mattastic »

Yeah. That's what the tutorial on the wiki said to do, and the one here doesn't specify.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

If so, the wiki's tutorial is wrong. Which page says that, please?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Mattastic
Engineer
Engineer
Posts: 5
Joined: 20 Jul 2007 16:44

Re: Howto apply a patch/diff file

Post by Mattastic »

The offending page is here. The bit in question is at the bottom.

Right, I'm now guessing I'm meant to put the text in the config file. First I tried putting it at the extreme top of the file, which got me the message: "ini: 'patch -p0 < filename.patch' outside of group" on loading and closing OTTD, after which the addition was removed by the program. I've tried putting it under the groups in the config file, but so far none of those have seemed appropriate and failed to achieve any result.

I ask only this: where do I put that one line of text, and what folder does the actual patch file go in. Those seem to be the only questions that never get answered anywhere.
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 623
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: Howto apply a patch/diff file

Post by glx »

wiki wrote:Linux: Type the following line into a console (replace patch_name with the filename of the patch):
Well "a console" means a terminal, not the openttd ingame console.
Mattastic
Engineer
Engineer
Posts: 5
Joined: 20 Jul 2007 16:44

Re: Howto apply a patch/diff file

Post by Mattastic »

Okay. What console/terminal/whatever do I type this into?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

The same one where you'd type "./configure && make" to build OpenTTD.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
kilo.dollar
Traffic Manager
Traffic Manager
Posts: 161
Joined: 02 Jul 2007 08:45
Location: Harare

Re: Howto apply a patch/diff file

Post by kilo.dollar »

I seem unable to proceed. What should I do in this instance?
See attached error message.
Attachments
svn.error.png
svn.error.png (10.98 KiB) Viewed 3337 times
I think that I may never see,
A billboard as lovely as a tree.
Perhaps, unless the billboards start to fall,
I may never see a tree at all.
User avatar
kilo.dollar
Traffic Manager
Traffic Manager
Posts: 161
Joined: 02 Jul 2007 08:45
Location: Harare

Re: Howto apply a patch/diff file

Post by kilo.dollar »

What files are modified by applying a patch, and if I get someone's patched files and replace mine, is my game already patched that way?
I think that I may never see,
A billboard as lovely as a tree.
Perhaps, unless the billboards start to fall,
I may never see a tree at all.
User avatar
rav
Traffic Manager
Traffic Manager
Posts: 253
Joined: 17 May 2007 13:36
Location: Netherlands
Contact:

Re: Howto apply a patch/diff file

Post by rav »

please avoid double posting kilo.dollar..

to answer your questions:
1) the correct url is (IIRC) svn://svn.openttd.org
2) yes, if you replace your files with the files you've received/copied n' pasted your game will be patched
User avatar
kilo.dollar
Traffic Manager
Traffic Manager
Posts: 161
Joined: 02 Jul 2007 08:45
Location: Harare

Re: Howto apply a patch/diff file

Post by kilo.dollar »

Thanks, Rav, since I am failing is anyone willing to patch for me with the do_not_build_inconnective_roads_r10722.patch?
I think that I may never see,
A billboard as lovely as a tree.
Perhaps, unless the billboards start to fall,
I may never see a tree at all.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 19 guests