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
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: Howto apply a patch/diff file

Post by Gremnon »

Mm, on compiling, I've a little issue. I've a Windows Vista laptop I tried to follow the wiki on, but I hit a few snags.

Firstly, it seems Subversion doesn't supply binaries any more, and their linked-to options don't seem to be all that helpful for MinGW/Msys use.
Secondly, when it comes to checking to see if gcc has installed, it apparently doesn't exist.

The latter isn't much of a problem if I can't get subversion so I can check it out, unless someone can write an alternate guide for getting and compiling trunk via mercurial or git.
I also noted that there was a warning about versions of gcc, so I'm going to go back and fiddle around with different versions and see if that changes anything.
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 »

Subversion binaries for most platforms can be easily found at the project homepage: http://subversion.apache.org/packages.html

You can also pull OpenTTD trunk repository using mercurial (from http://hg.openttd.org/openttd/trunk.hg).
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: Howto apply a patch/diff file

Post by Gremnon »

Aye, I saw those binaries. They're not officially generated, which isn't necessarily a bad thing as such, but they all insist on being installed, and after I couldn't track down where one of them was, and the other didn't seem to work with MinGW/Msys, I stopped trying.

I also know it's possible to pull by git or hg - I just haven't a clue how to enable my MinGW environment to be able to do it, so instead of using 'svn co...' I can instead just use the same analogous command for either of them.

It's been a while since I compiled OpenTTD last. Bear with me while I try to catch up and let everything come back to me.
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 »

I have both Subversion and Mercurial installed outside of msys and added to PATH. They work fine with mingw32/msys unless you try to do something strange (such as enabling the color extension for Mercurial).
Flamefire
Engineer
Engineer
Posts: 19
Joined: 07 Aug 2010 15:03

Re: Howto apply a patch/diff file

Post by Flamefire »

I got a problem too: (I'm using TortoiseSVN)
I have a patch that applies to an older version without problems. But i want it to apply to the current one.
Some files are shown black (no problem) but others say "...patch outdated...(lines) does not match..."

I got no way to fix it manually. Just this message (I remember using TortoiseGIT where a 3-View was shown, where i can fix that stuff manually)

How can i proceed?
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 »

Open the files with problems and their .rej files. Fix the rejected hunks manually, checking the .rej files and correcting their corresponding file accordingly. There might be a 3-way diff program for windows, but I don't know any.
Dante123
Chief Executive
Chief Executive
Posts: 672
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: Howto apply a patch/diff file

Post by Dante123 »

following the EXACT steps as shown here: http://wiki.openttd.org/Compiling_on_MinGW

i get a error like this:
error1.PNG
error1.PNG (43.9 KiB) Viewed 1335 times

i tried 3 times, so thats why some of the errors are like: already exist.
but somehow i think there is some line missing or something in this wiki page ?
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Howto apply a patch/diff file

Post by Eddi »

the first error is usually the clue. you tell it to extract to a directory /tmp1, but that directory doesn't exist.

"./mingwPORT.sh: cd: /tmp1: No such file or directory"
Last edited by Eddi on 15 Aug 2010 14:26, edited 1 time in total.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Howto apply a patch/diff file

Post by Rubidium »

The download location of one of the files has gone, so another approach has to be taken (according to other posts on this forum). Just nobody has fixed the wiki.
Dante123
Chief Executive
Chief Executive
Posts: 672
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: Howto apply a patch/diff file

Post by Dante123 »

Eddi wrote:the first error is usually the clue. you tell it to extract to a directory /tmp1, but that directory doesn't exist.
but it sould make it right ?

or what is the correct command to make it ? previous i never had to make it like this


**EDIT**
same error when i do make the file.

its more that 404 error that makes it not work i guess
Attachments
error2.PNG
error2.PNG (61.34 KiB) Viewed 1335 times
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Howto apply a patch/diff file

Post by Eddi »

the command to create a directory is "md" or "mkdir" [for "make directory"]
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 »

Accept the defaults. But you'll run into the error that the file you will try to download (zlib-1.2.3) doesn't exist anymore...
Manual install is called for - or maybe a newer install script exists there meanwhile.
Dante123
Chief Executive
Chief Executive
Posts: 672
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: Howto apply a patch/diff file

Post by Dante123 »

how do i do this manual, or more like, where is the good location to put what files ?

or well, maybe any1 of you can help me out, maybe trough teamviewer (remote desktop)
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Howto apply a patch/diff file

Post by Eddi »

you got a different error now. always check the first error, it changed from "directory does not exist" to "the download location does not exist". likely you need to download a newer version (1.2.5 or something).
Dante123
Chief Executive
Chief Executive
Posts: 672
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: Howto apply a patch/diff file

Post by Dante123 »

Eddi wrote:you got a different error now. always check the first error, it changed from "directory does not exist" to "the download location does not exist". likely you need to download a newer version (1.2.5 or something).
well for a dummy on this terrain i just need to follow some guid step by step and than i get it to work (like it was on my previous machine)
so really i dont have a clue now how i change versions and that kind of stuff :roll:

p.s. all i want is to compile the latest version if chill's patchpack, so if any1 could do that, thats also a alternative for this whole installing :lol:
Dante123
Chief Executive
Chief Executive
Posts: 672
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: Howto apply a patch/diff file

Post by Dante123 »

so, if i want to make it manual.
where exactly is he trying to make this "tmp" dir ? (i cant find where he is looking for this)
and am i correct that when i than put the tar.b2 inside there manual, it will work ?
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: Howto apply a patch/diff file

Post by Lord Aro »

i believe i now know exactly how to make a newer version :mrgreen:
i should hopefully have it uploaded by tomorrow evening (15/08), and almost certainly by day after
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Howto apply a patch/diff file

Post by Eddi »

Dante123 wrote:so, if i want to make it manual.
where exactly is he trying to make this "tmp" dir ? (i cant find where he is looking for this)
and am i correct that when i than put the tar.b2 inside there manual, it will work ?
this is probably a subdirectory of where you installed msys to (like C:\Program Files\msys or so)
User avatar
Dwight_K._Schrute
Traffic Manager
Traffic Manager
Posts: 209
Joined: 01 Sep 2010 11:29

Re: Howto apply a patch/diff file

Post by Dwight_K._Schrute »

So I hope anybody can help me here...

I have a git repository and a SVN diff-file... what can I do to use it anyway...

I use TortoiseGIT in Windows...
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 »

What have you tried?
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 9 guests