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

konrado345
Engineer
Engineer
Posts: 11
Joined: 02 Aug 2007 11:12

Re: Howto apply a patch/diff file

Post by konrado345 »

I have a problem in Tortoise SNV during compiling open TTD:

"... path.../Open TTD Nightly/airport_movement.h" has no URL.

What does it mean? What should I do?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

I'm guessing your checkout is toast. If so, the best solution I know is

Code: Select all

$ rm -rf *
$ svn co svn://svn.openttd.org/trunk .
If you typoed the file path, and airport_movement.h is really in the src directory, do this instead

Code: Select all

$ rm -rf src
$ svn up
Similar solutions apply for other directories.

Note that these will blow away any local changes, either in the entire checkout or in the src directory. If svn diff works, then save its output and apply patch after rebuilding the checkout. If it does not, and you don't have the necessary patch files already, you might want to wait and see if someone else has a better solution.
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
konrado345
Engineer
Engineer
Posts: 11
Joined: 02 Aug 2007 11:12

Re: Howto apply a patch/diff file

Post by konrado345 »

I rebuilded the checkout and the problem is again, some files are right and some are wrong, but when I patch the files must I save them or I can close the TortoiseSVN without any saving?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

Sure you can close Tortoise without saving. But only if you don't want to save the changes. If you do want to save the changes, then you need to save.

Tortoise is a bit stupid about applying patches. You have to open the patch, and then you have to tell Tortoise that you actually want to apply the patch by right-clicking on the file list and selecting "Patch All". This may automatically save, I don't remember.
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
konrado345
Engineer
Engineer
Posts: 11
Joined: 02 Aug 2007 11:12

Re: Howto apply a patch/diff file

Post by konrado345 »

Are there any patches for Open TTD Nightly r10737 on windows which are in 100 percent right? Names and links, please.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

No. If they were 100% right, they'd be in trunk.
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
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Howto apply a patch/diff file

Post by athanasios »

If they are considered to add something usefull...
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Howto apply a patch/diff file

Post by MJS »

Well, how do you define 100% right? Some patches will never crash OTTD, and their coding style is wonderful - but if the GUI is worthless, they probably are still on hold. In most cases, however, it is the principle and the GUI that are done first, followed by being crash-free and in the end being coded nicely. Or don't you folks agree?
sobo
Engineer
Engineer
Posts: 89
Joined: 13 Sep 2004 17:42
Contact:

Re: Howto apply a patch/diff file

Post by sobo »

Hi.
got a question:
I downloaded a patch file and clicked 'Patch all' in Tortoise window.
Then something happened and it also finished (despite giving me 4 errors IIRC)

What am I supposed after that in order to actually play with the patch ?

(sorry if thats a stupid question but its not mentioned in the guide on page 1, and Ive never done anything alike)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

sobo wrote:Then something happened and it also finished (despite giving me 4 errors IIRC)
What happened? "something" can describe anything from Mom calling you for dinner to smoke emerging from your PSU.
What were the error messages?
sobo wrote:What am I supposed after that in order to actually play with the patch ?
I think you need to try that question again.
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
sobo
Engineer
Engineer
Posts: 89
Joined: 13 Sep 2004 17:42
Contact:

Re: Howto apply a patch/diff file

Post by sobo »

Thanks for your interest, DaleStan.

Ok Im trying (and documentating) again:
I did the SVN Checkout on a folder which "Completed at revision 11082"
Then I tried to add the patch in the attachment.
Some files in the list are shown red, but according to post on page 1, this can be normal. So i proceed.
I patch all:
I get several 'still unresolved errors' like this one (this is the first one in roadveh_gui.cpp at line 129)
Other errors occur in train.h, traingui.cpp, tunnelbridge_cmd.cpp

I ignored these by clicking Yes (I would fix them in another editor) in the Tortoise error box.
Then the "it finished" from me previous post happened :).

I have a folder of uncompiled game files, which hopefully have a patch applied, but how do I compile them and with which app, in order to get the program files ?
Attachments
patch_physics_r11037_02-09-2007.patch
This is a physics patch, supposed to remove maximum train speeds
(161.41 KiB) Downloaded 101 times
ThePenguin
Engineer
Engineer
Posts: 40
Joined: 15 May 2007 16:49

Re: Howto apply a patch/diff file

Post by ThePenguin »

@sobo: You can use Visual C++ Express Edition. There are some docs on the OpenTTD wiki.
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Re: Howto apply a patch/diff file

Post by kaan »

If you are on a windows platform that is supported I will suggest that you use BuildOTTD. See the sticky thread for more info.

Code: Select all

if (YouAreHappyAndYouKnowIt) {
    ClapYourHands();
}
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

sobo wrote:I get several 'still unresolved errors' like this one
Like which one? And are you quite sure it doesn't say "conflicts"? (And if it does, why'd you type "errors" instead of "conflicts"?)

If there are conflicts, you have to know enough C++ to resolve them before you can compile, regardless of which compiler you use.
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've had problems with BuildOTTD which were not resolved. Is there anyone willing to assist, through PM?
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
Benbo
Transport Coordinator
Transport Coordinator
Posts: 380
Joined: 09 Jan 2006 18:51
Location: UK

Re: Howto apply a patch/diff file

Post by Benbo »

Since my ruuubbish understanding of computers nearly 2 years ago on the first page, I've bought a Mac. Anyone else got one and know how to get the patches running?
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Re: Howto apply a patch/diff file

Post by Bjarni »

Benbo wrote:Since my ruuubbish understanding of computers nearly 2 years ago on the first page, I've bought a Mac. Anyone else got one and know how to get the patches running?
I do :wink:

Basically you open the terminal (/Applications/Utilities/Terminal) and do it the linux way. You will like to add terminal to your dock for quick access because if you want to compile anything yourself then you will often need it.

Benbo wrote:Am hoping to learn some NFO and GRF making with my Mac - that'll be easy :wink:
Don't be too sure. Nobody managed to port the newGRF codec to OSX yet :(
User avatar
Benbo
Transport Coordinator
Transport Coordinator
Posts: 380
Joined: 09 Jan 2006 18:51
Location: UK

Re: Howto apply a patch/diff file

Post by Benbo »

OK thanks. I'll try it.
Bjarni wrote:
Benbo wrote:Am hoping to learn some NFO and GRF making with my Mac - that'll be easy :wink:
Don't be too sure. Nobody managed to port the newGRF codec to OSX yet :(
Sorry, its meant to come across as sarcastic. Obviously didn't work :x
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

Bjarni wrote:
Benbo wrote:Am hoping to learn some NFO and GRF making with my Mac - that'll be easy :wink:
Don't be too sure. Nobody managed to port the newGRF codec to OSX yet :(
Patchman did that several months ago now. I still can't compile for MacOS, so you'll have to compile yourself before you can use GRFCodec, but if you're already compiling Open, that shouldn't be too much of a problem.
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
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Re: Howto apply a patch/diff file

Post by Bjarni »

DaleStan wrote:
Bjarni wrote:
Benbo wrote:Am hoping to learn some NFO and GRF making with my Mac - that'll be easy :wink:
Don't be too sure. Nobody managed to port the newGRF codec to OSX yet :(
Patchman did that several months ago now. I still can't compile for MacOS, so you'll have to compile yourself before you can use GRFCodec, but if you're already compiling Open, that shouldn't be too much of a problem.
It wasn't the endian issue that prevented newGRF codec from working on OSX, it's something else... I just checked out the svn head revision (r1778) and it still fails.

Code: Select all

[STRIP/UPX] grfmrgc.bin
make: upx: Command not found
I don't recall this error. I think it was more like it compiled, but was unable to produce working grf files, so just solving this is not the same as it just works (would be nice though)

Note: this tend to go off topic from applying patch/diff files. If anybody wants to talk more about this then we should split it out and make it a thread of it's own
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 14 guests