Problem applying advance signal patch

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Berner
Engineer
Engineer
Posts: 7
Joined: 28 Oct 2009 16:14

Problem applying advance signal patch

Post by Berner »

I have a problem with applying the advance signal patch from here. When I select "apply patch" in TortoiseSVN theres no patch file list showing up (like it normally does). Im not good in programming/compile etc. so am im doing something wrong or is there perhaps an other way to apply it.

Hope somone can help me.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Problem applying advance signal patch

Post by Yexo »

That patch is made with git and TortoiseSVN doesn't support patches made with git. Your best option is to install patch (part of msys and mingw).
Berner
Engineer
Engineer
Posts: 7
Joined: 28 Oct 2009 16:14

Re: Problem applying advance signal patch

Post by Berner »

How is it exactly working? Do I have to install msys OR mingw or both and is there a similar thing to the Tortoise "apply patch"?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Problem applying advance signal patch

Post by planetmaker »

All you'll get is command line tools. No clicky-no-brainy-compily. The wiki of mingw is very good.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Problem applying advance signal patch

Post by Zuu »

Berner wrote:How is it exactly working? Do I have to install msys OR mingw or both
Just one of them should be enough. Since from a newbies perspective they are equivalent. You may also try this patch binary: http://gnuwin32.sourceforge.net/packages/patch.htm

Make sure to first convert the files to windows style line feeds. As they say on the provided link that you should do. If the patch/diff-file you download is made on a Linux system they usually have just the new line symbol but on windows you need to have both new line and carriage return at the end of each line. To complicate things even further, Mac only uses the carriage return symbol to mark line breaks. Either get the unix2dos program or use a text editor which support reading and converting between different line ending styles.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: Problem applying advance signal patch

Post by Gremnon »

Failing all else, use the link in my signature (The part where it says THIS PAGE) to learn how to compile without any patches on Windows, then if that works for you, before compiling, simply use patch, run configure, compile, and consume finished product. Serves many.
Berner
Engineer
Engineer
Posts: 7
Joined: 28 Oct 2009 16:14

Re: Problem applying advance signal patch

Post by Berner »

I nearly managed it. When I try to apply the patch I get a lot of "FAILED" and It wont compile properly.

Here's the screen from mingw, hope you can help me:

Code: Select all

$ patch -p1 -i signal.patch
patching file `src/lang/english.txt'
Hunk #1 FAILED at 1196.
Hunk #2 FAILED at 1734.
Hunk #3 FAILED at 3706.
3 out of 3 hunks FAILED -- saving rejects to src/lang/english.txt.rej
patching file `src/misc/dbg_helpers.cpp'
Hunk #1 FAILED at 45.
1 out of 1 hunk FAILED -- saving rejects to src/misc/dbg_helpers.cpp.rej
patching file `src/newgrf.cpp'
Hunk #1 succeeded at 3578 (offset 51 lines).
patching file `src/npf.cpp'
Hunk #1 succeeded at 379 (offset -23 lines).
patching file `src/pbs.cpp'
Hunk #1 succeeded at 354 (offset 9 lines).
patching file `src/rail_cmd.cpp'
Hunk #1 FAILED at 944.
Hunk #2 succeeded at 1568 (offset 26 lines).
Hunk #3 FAILED at 1880.
Hunk #4 succeeded at 2222 (offset -60 lines).
Hunk #5 FAILED at 2283.
Hunk #6 FAILED at 2300.
Hunk #7 FAILED at 2310.
Hunk #8 FAILED at 2320.
Hunk #9 FAILED at 2330.
Hunk #10 FAILED at 2340.
8 out of 10 hunks FAILED -- saving rejects to src/rail_cmd.cpp.rej
patching file `src/rail_gui.cpp'
Hunk #1 FAILED at 40.
Hunk #2 succeeded at 1503 with fuzz 1 (offset 136 lines).
Hunk #3 FAILED at 1555.
Hunk #4 succeeded at 1470 (offset 18 lines).
Hunk #5 FAILED at 1514.
Hunk #6 FAILED at 1522.
Hunk #7 FAILED at 1531.
5 out of 7 hunks FAILED -- saving rejects to src/rail_gui.cpp.rej
patching file `src/rail_map.h'
Hunk #1 succeeded at 289 (offset -60 lines).
Hunk #3 succeeded at 356 (offset -60 lines).
Hunk #5 succeeded at 476 (offset -60 lines).
patching file `src/saveload/afterload.cpp'
Hunk #1 succeeded at 1949 with fuzz 2 (offset 227 lines).
patching file `src/saveload/saveload.cpp'
Hunk #1 FAILED at 38.
1 out of 1 hunk FAILED -- saving rejects to src/saveload/saveload.cpp.rej
patching file `src/settings.cpp'
Hunk #1 FAILED at 1505.
1 out of 1 hunk FAILED -- saving rejects to src/settings.cpp.rej
patching file `src/signal.cpp'
Hunk #1 succeeded at 334 (offset -2 lines).
patching file `src/signal_func.h'
Hunk #1 succeeded at 16 (offset 7 lines).
patching file `src/signal_type.h'
Hunk #1 succeeded at 27 (offset 7 lines).
patching file `src/table/sprites.h'
Hunk #1 succeeded at 139 (offset 8 lines).
patching file `src/train_cmd.cpp'
Hunk #1 FAILED at 38.
Hunk #2 succeeded at 2381 (offset 55 lines).
Hunk #4 succeeded at 2548 (offset 64 lines).
Hunk #5 FAILED at 2741.
Hunk #6 succeeded at 2879 (offset -1 lines).
Hunk #7 succeeded at 2961 (offset 64 lines).
Hunk #8 FAILED at 3029.
Hunk #9 succeeded at 3005 (offset -1 lines).
Hunk #10 succeeded at 3079 (offset 64 lines).
Hunk #11 FAILED at 3095.
Hunk #12 FAILED at 3124.
Hunk #13 FAILED at 3140.
Hunk #14 FAILED at 3764.
Hunk #15 FAILED at 3840.
Hunk #16 succeeded at 4242 (offset 19 lines).
Hunk #17 FAILED at 4332.
9 out of 17 hunks FAILED -- saving rejects to src/train_cmd.cpp.rej
patching file `src/yapf/yapf_costrail.hpp'
Hunk #1 succeeded at 240 (offset 16 lines).
Hunk #2 succeeded at 456 (offset 3 lines).
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: Problem applying advance signal patch

Post by Gremnon »

The 'Failed' messages are parts of the patch that didn't apply cleanly - in other words, the instructions in the patch file, didn't match up right with the source code.
Your best bet is to find the exact svn revision the patch was made for - which should be in the patch's file name - and check out that revision instead, by using:

Code: Select all

svn checkout svn://svn.openttd.org/trunk -r<insert revision number here>
Then continue as normal.
Berner
Engineer
Engineer
Posts: 7
Joined: 28 Oct 2009 16:14

Re: Problem applying advance signal patch

Post by Berner »

The patch name is 'advance_signals_v2.patch' (Link in my first post). I havent found a revision number. Is there an other possibility to find it out?
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: Problem applying advance signal patch

Post by Gremnon »

As it's a patch made with git, instead of svn, the patchfile itself doesn't help.
I would find the thread for the patch in the OpenTTD Development subforum, and see if that sheds any light on it (I'm also going looking too, to see if I can find it myself)

Edit: Alright. It seems there isn't a thread. I'm not certain then how to find the SVN revision, however, I suspect you could find out how to use git instead, and match the git revision instead of the svn one, but I have little to no knowledge of how git works, so I can't help much there.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Problem applying advance signal patch

Post by Yexo »

Looking at the date the file was uploaded it's probably a revision somewhere around r15400
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Problem applying advance signal patch

Post by petert »

The topic should also tell you what revision it is.
Berner
Engineer
Engineer
Posts: 7
Joined: 28 Oct 2009 16:14

Re: Problem applying advance signal patch

Post by Berner »

I tried it with r15500 and it worked :D
Thank you all for your help
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Problem applying advance signal patch

Post by petert »

Welcome, would you mind posting a zip binary, I've become sort of interested and don't really feel like compiling. :)
Berner
Engineer
Engineer
Posts: 7
Joined: 28 Oct 2009 16:14

Re: Problem applying advance signal patch

Post by Berner »

It didnt work. After compiling the game didnt start, and now i cant even apply the patch anymore. So I gave up. Its not worth the trouble.
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: Problem applying advance signal patch

Post by Gremnon »

Did you remember to add the newgrf from the page that's required for the new signal graphics? That may have been why it didn't start.
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Problem applying advance signal patch

Post by petert »

Yes, here
Berner
Engineer
Engineer
Posts: 7
Joined: 28 Oct 2009 16:14

Re: Problem applying advance signal patch

Post by Berner »

The Problem is, that I deleted the compiled version, and now I cant download it again. It says:

Code: Select all

svn: warnung: Fehler beim Umgang mit der Definition des externen Verweises für trunk\src\3rdparty\squirrel®:
svn: warnung: URL ¯svn://svn.openttd.org/3rdparty/squirrel® existiert nicht in Revision 17919
Ausgecheckt, Revision 15500.
Dont know what it means ?(
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Problem applying advance signal patch

Post by Eddi »

try this line instead:

Code: Select all

svn checkout svn://svn.openttd.org/trunk@15500
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Problem applying advance signal patch

Post by petert »

How did you know that he was using something different? Such as:

Code: Select all

svn checkout svn://svn.openttd.org/trunk -r15500
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 4 guests