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
neob
Chief Executive
Chief Executive
Posts: 687
Joined: 29 Dec 2009 02:56

Re: Howto apply a patch/diff file

Post by neob »

Code: Select all

/c/ottd/svn32bpp/findversion.sh: svnversion: command not found
/c/ottd/svn32bpp/findversion.sh: svn: command not found
/c/ottd/svn32bpp/findversion.sh: svn: command not found
/c/ottd/svn32bpp/findversion.sh: svn: command not found
cp: cannot stat `objs/WIN64/Release/openttd.exe': No such file or directory
make: *** [all] Error 1
damn, any ideas?
Image
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Howto apply a patch/diff file

Post by petert »

Oh! Sorry. :oops: I wrote that guide lacking some information.
I'm updating it now.

Check out the differences I've made: http://wiki.openttd.org/?title=Microsof ... ldid=35195
(Basically, also Install SVN with the MSYS guide, then it should work)
User avatar
neob
Chief Executive
Chief Executive
Posts: 687
Joined: 29 Dec 2009 02:56

Re: Howto apply a patch/diff file

Post by neob »

there is some progress (i was compiling 64bit version)

Code: Select all

$ make -f makefile.msvc bundle PLATFORM=WIN64
cp: cannot stat `objs/WIN64/Release/openttd.exe': No such file or directory
make: *** [all] Error 1
EDIT: fixed it the platform name is x64 not WIN64, ok new error:

Code: Select all

[BUNDLE] Constructing bundle
/bin/sh.exe: unix2dos: command not found
make: *** [bundle] Error 127
Image
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Howto apply a patch/diff file

Post by petert »

You can't compile a 64-bit version with Express Editions, as glx enlightened me today on IRC, only 32-bit. If you get the full version, you can compile both.

If you have your configuration manager set to "x64" it will skip the project openttd. Trust me, I've tried.
User avatar
neob
Chief Executive
Chief Executive
Posts: 687
Joined: 29 Dec 2009 02:56

Re: Howto apply a patch/diff file

Post by neob »

i got the full VS2008 PRO and its worked, my obj\x64 folder is just like OBj\Win32 full of 250MB of files
Last edited by neob on 10 Jan 2010 02:35, edited 1 time in total.
Image
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Howto apply a patch/diff file

Post by petert »

neob wrote:

Code: Select all

[BUNDLE] Constructing bundle
/bin/sh.exe: unix2dos: command not found
make: *** [bundle] Error 127
Happens to me too, don't worry about that. I tried to get unix2dos, but it requires tons of dll's which I had to hunt down, then it hangs when running make bundle.
User avatar
neob
Chief Executive
Chief Executive
Posts: 687
Joined: 29 Dec 2009 02:56

Re: Howto apply a patch/diff file

Post by neob »

ok, i found it, the bundle is the SVN source folder, i was expecting it in the miniGW.

ok so its done, anyway to check it? beside starting it and checking that the fullzome works - which worked.


EDIT: by the way thanks for your effort and the WIKI guide, its basically step by step for dummy's which was perfect for me :lol:
Attachments
32bpp_win64_r18768.rar
(3.72 MiB) Downloaded 111 times
Last edited by neob on 10 Jan 2010 02:49, edited 1 time in total.
Image
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Howto apply a patch/diff file

Post by petert »

neob wrote:ok so its done, anyway to check it? beside startign it nad checking if the fullzome works?
You should be confident that patching worked so the binary will work :-)

Anyway, please keep 32bpp binaries to the 32bpp forum/binary thread. I'll be happy to update the wiki on Installation with your binary if (and only if) you post it over there.
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: Howto apply a patch/diff file

Post by Wasila »

How do I revert to an earlier version? 'svn revert -r18778' gets

Subcommand 'revert' doesn't accept option '-r [--revision] ARG'

Thanks,
Wasila
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Howto apply a patch/diff file

Post by Yexo »

Try "svn up -r 18778"
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: Howto apply a patch/diff file

Post by Wasila »

Hmm... I don't know if that was it but I was entering the command while in the wrong folder. Thanks for fast reply!
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Howto apply a patch/diff file

Post by petert »

Hi all,
Terkhen made a great patching tool which is amazingly easy-to-use, especially for newbies who probably refer to helpful thread like these with compiling. Anyway, you can check out the website here: http://code.google.com/p/svn-scripts/ (Downloads)
Some features of svnscripts:
- Easy to set up
- Easy to use
- There is a script that tells you if you are missing the needed GNU Tools
- Auto-detects -p0 or -p1
- Automatically adds new files created during patching to the SVN Repo
To set up svnscripts:
- See README.TXT (Basically install a few GNU Tools and you're good)
- Online copy of the README.TXT available here: http://code.google.com/p/svn-scripts/so ... README.TXT
Bugs:
- Please post bug reports here: http://code.google.com/p/svn-scripts/issues/list

I have installed all the GNU packages, set up the batch files, but my MinGW/MSYS is messing with the batch scripts somehow.
Anyway, have fun patching, now that it is easy!

Peter
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Howto apply a patch/diff file

Post by Terkhen »

These scripts are still not suited for beginners. If a beginner has a problem using the standard commands, he will be able to find help in this thread or in google and solve his problem. If he has the same problem using the scripts, his only option is to ask me. And since the scripts are not complete (they lack a lot of error checking), I will not be able to guess what is the problem by the command output (I thought you would remember; at their current state some commands give a successful output even if they did nothing due to an error).

Also note that I stopped working on the batch (Windows) version; I won't be using svn on Windows enough to spend time on it. In conclusion: testing the bash version is welcome (as will be testing it on MSYS, theorically I could make work on both), but beginners should stick to more reliable methods.
Keprta
Engineer
Engineer
Posts: 2
Joined: 12 Feb 2010 21:08

Re: Howto apply a patch/diff file

Post by Keprta »

Hi,

My problem is following... I copy .diff file ( Day speed patch ) to OpenTTD folder and hit linux command to console ( patch... etc )
Then i get the following,i am pasting full console output here.

Code: Select all

root@martin:/usr/share/games/openttd/data# patch -p0 < r14293-daypatch.diff 
(Stripping trailing CRs from patch.)
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: src/aircraft_cmd.cpp
|===================================================================
|--- src/aircraft_cmd.cpp	(revision 14293)
|+++ src/aircraft_cmd.cpp	(working copy)
--------------------------
File to patch: 


And my openttd directory look like this. There is no src folder there or any cmd.cpp files.

Code: Select all

root@martin:/usr/share/games/openttd# ls
ai  data  gm  lang  r14293-daypatch.diff  scripts
root@martin:/usr/share/games/openttd# 


Any help?
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 »

Keprta wrote: Any help?
Yes, this thread has plenty of help on that and most probably plenty of people he posted virtually the same. Most notably, you first have to get the game's sources and apply the diff file to that and compile it. There exist no patches for the OpenTTD binary in this forum (well, maybe, but I never stumbled upon one, also it's pointless)
Engineer Mars
Engineer
Engineer
Posts: 37
Joined: 30 Aug 2008 14:31

Re: Howto apply a patch/diff file

Post by Engineer Mars »

Please help! When I tried coding, I wrecked my Boot.ini. I had to use a boot disc for restarting till I placed a new one in. Could someone give me any idea to code on openttd with a Windows Home SP2.
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:Please help! When I tried coding, I wrecked my Boot.ini. I had to use a boot disc for restarting till I placed a new one in. Could someone give me any idea to code on openttd with a Windows Home SP2.
Can you please be a bit more specific on what you're trying to achieve? You can use MSVC on Windows to edit and compile OpenTTD source. Check out the guides at the wiki: http://wiki.openttd.org/MSVC
Engineer Mars
Engineer
Engineer
Posts: 37
Joined: 30 Aug 2008 14:31

Re: Howto apply a patch/diff file

Post by Engineer Mars »

I don't understand the Microsoft C++ concept.
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 don't understand the Microsoft C++ concept.
I suggest you do some reading on how to program a computer, in particular about programming languages, compiling, and source code.

In short, computers only understand numbers. To program a computer you either have to speak in numbers to it, or you use a programming language like C++ to express what you mean.
C++, like most programming languages, uses statements and math operators, it has concepts like function, variables, and classes. To convert that to numbers, you need a compiler, like the MSVC C++ compiler.
Engineer Mars
Engineer
Engineer
Posts: 37
Joined: 30 Aug 2008 14:31

Re: Howto apply a patch/diff file

Post by Engineer Mars »

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
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 18 guests