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
Thalass
Traffic Manager
Traffic Manager
Posts: 200
Joined: 02 Jul 2004 13:29
Location: Ontario, Canada

Re: Howto apply a patch/diff file

Post by Thalass »

Ah! Thank you. So as long as I'm careful as to which .diffs I apply, I should have no problems.
dante
Engineer
Engineer
Posts: 75
Joined: 17 Dec 2007 16:56

Re: Howto apply a patch/diff file

Post by dante »

so i followed instruction as meush sayed in page 1.

i didn't had to click any openttd file or any ather ttd file. so how do i know it is inplanted in my game now?
gutsy
Engineer
Engineer
Posts: 17
Joined: 04 Feb 2008 22:33
Location: Dresden, Germany

Re: Howto apply a patch/diff file

Post by gutsy »

Can anyone help me, please?

I want to patch my "r12042" with "passenger-dest-11810.patch". Is this possible?

I've folow problem by patching:

I don't know what do I have to type by "File to patch:" ?(

Hope anyone can help me.
Attachments
What do I have to type here?
What do I have to type here?
passenger-dest.png (20.12 KiB) Viewed 4897 times
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: Howto apply a patch/diff file

Post by cirdan »

gutsy wrote:I want to patch my "r12042" with "passenger-dest-11810.patch". Is this possible?
It depends on how different r12042 is from r11810, and on how invasive that patch is.
gutsy wrote:I don't know what do I have to type by "File to patch:" ?(
You shouldn't need to type anything. When patch asks for the file to patch, it means that it hasn't found the file itself. There are two main causes for that:
1. You're trying to apply the patch from the wrong directory (that's the hint that patch gives you about the -p option).
2. The code you're trying to apply the patch to is so different from the original that the file to patch no longer exists.

In your case, the most likely reason is 1. (You seem to have erased the shell prompt in the top line of your image, so I can't tell for sure.) Perhaps you're trying to apply the patch from the wrong directory? Your working directory should be the root directory of the distribution (the one containing the configure script).
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Howto apply a patch/diff file

Post by Roujin »

I agree with cirdan and if you get this error, you should try other numbers with the -p option e.g. -p1

230 revisions apart, that's quite a lot in my opinion.. I doubt it will work completely.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
gutsy
Engineer
Engineer
Posts: 17
Joined: 04 Feb 2008 22:33
Location: Dresden, Germany

Re: Howto apply a patch/diff file

Post by gutsy »

I'm sorry.
I didn't have a src file in my folder.

My problem is now that I can't configure any source files of OTTD-source-nightly-rxx.. .
My Terminal says follow: (go to #1)

If I try to install g++ (go to #2)

Sorry, it's all in german. I tryied to install the following packages, but not one is istallable.

By the last package I got follow message:
"Die folgenden Pakete haben nichterfüllte Abhängigkeiten:
libc6-dev: Hängt ab: libc6 (= 2.6.1-1ubuntu9) aber 2.6.1-1ubuntu10 soll installiert werden
E: Kaputte Pakete"

But I need libc6. How can I install g++, when it isn't compatible?
Has anyone an idee?
Attachments
#1
#1
configure_error.png (47.78 KiB) Viewed 4832 times
#2
#2
install_error.png (48.34 KiB) Viewed 4837 times
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

gutsy wrote:Has anyone an idee?
Get the output to appear in English so we can read it?
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
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Howto apply a patch/diff file

Post by Roujin »

The important part translates roughly as:
"The following packages have not fullfilled dependencies:
g++: depends on: g++-4.1 (>= 4.1.2-1), but is not requested to be installed"
or something like this..

I guess it means that you need the package "g++-4.1", but didn't select it to be installed as well... maybe there's an option that all packages that are needed are automatically installed as well? I'm not really familiar with linux..
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
gutsy
Engineer
Engineer
Posts: 17
Joined: 04 Feb 2008 22:33
Location: Dresden, Germany

Re: Howto apply a patch/diff file

Post by gutsy »

How can I get the output in english?
User avatar
CMircea
Chairman
Chairman
Posts: 887
Joined: 29 Dec 2006 14:05

Re: Howto apply a patch/diff file

Post by CMircea »

Try this:

Code: Select all

$ sudo apt-get install build-essential libsdl1.2-dev subversion zlib1g-dev timidity dpatch
(if you don't need the original TTD music to play, remove timidity from there, it's a CPU waster)
gutsy
Engineer
Engineer
Posts: 17
Joined: 04 Feb 2008 22:33
Location: Dresden, Germany

Re: Howto apply a patch/diff file

Post by gutsy »

Thanks for your help,
but if I try to do this my consol says that it needs:
libc6-dev, libc-dev, libglu1-xorg-dev, libglu-dev

I already have libc6 but in the
same line is written 2.6.1-.ubuntu10

for ttd it needs, I think, 2.6.1-.ubuntu9
Is this correct?

Can I uninstall 2.6.1-.ubuntu10?
But I do not want that my system after this is not more working,
because I have to uninstall 1156 packages and I get 2227 MB more space on harddisk

Someone an Idee?
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: Howto apply a patch/diff file

Post by cirdan »

gutsy wrote:How can I get the output in english?
Try prepending 'LANGUAGE=en' to your commands, like this:

Code: Select all

~$ LANGUAGE=en ls /aaaa 
/bin/ls: cannot access /aaaa: No such file or directory
~$ LANGUAGE=de ls /aaaa
/bin/ls: Zugriff auf /aaaa nicht möglich: Datei oder Verzeichnis nicht gefunden
~$ LANGUAGE=fr ls /aaaa
/bin/ls: ne peut accéder /aaaa: Aucun fichier ou répertoire de ce type
gutsy wrote:Thanks for your help,
but if I try to do this my consol says that it needs:
libc6-dev, libc-dev, libglu1-xorg-dev, libglu-dev
That's normal. You seem to lack the complete toolchain, plus development headers and libraries. Most probably you didn't select them when you first installed your distribution.
gutsy wrote:I already have libc6 but in the
same line is written 2.6.1-.ubuntu10

for ttd it needs, I think, 2.6.1-.ubuntu9
Is this correct?

Can I uninstall 2.6.1-.ubuntu10?
But I do not want that my system after this is not more working,
because I have to uninstall 1156 packages and I get 2227 MB more space on harddisk
I don't have much experience with distributions (ubuntu in your case), as I abandoned them long ago, but you shouldn't have to uninstall anything (unless the package manager is broken). If I understand correctly, you have libc-2.6.1-ubuntu10 installed, but some package says that it requires libc-2.6.1-ubuntu9, right? This is weird: a package should not require a version older than the installed one (but, again, I've seen such things happen).

I'd suggest that you try to install whatever packages are required (libc-devel, etc.), as per Desolator's advice. Don't uninstall anything, and don't pay much attention at first to version mismatches (those can be fixed later).
gutsy
Engineer
Engineer
Posts: 17
Joined: 04 Feb 2008 22:33
Location: Dresden, Germany

Re: Howto apply a patch/diff file

Post by gutsy »

Thanks a lot, but I didn't tried again.
Because this patch is not working in multi player.
anon1234
Engineer
Engineer
Posts: 12
Joined: 10 Feb 2008 09:53

Re: Howto apply a patch/diff file

Post by anon1234 »

I have a question (I'm new to this):

Are these patch/diff files the same as the patches described there:
http://wiki.openttd.org/index.php/Patches
?

If someone uploads a patch/diff file, is there a chance that this will be a built-in feature in the future (so no patch anymore)? Or will it stay always a patch that the user has to apply and compile for himself?
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: Howto apply a patch/diff file

Post by cirdan »

maststef wrote:I have a question (I'm new to this):

Are these patch/diff files the same as the patches described there:
http://wiki.openttd.org/index.php/Patches
?
No, they are different things with an unfortunate name coincidence.

Patch/diff files contain a "set of changes" that have to be applied to some code (as in the OpenTTD source code). Usually their goal is to fix a bug, add a feature, etc.

The patches described at http://wiki.openttd.org/index.php/Patches are more like options that can be configured in the game.
maststef wrote:If someone uploads a patch/diff file, is there a chance that this will be a built-in feature in the future (so no patch anymore)? Or will it stay always a patch that the user has to apply and compile for himself?
The former. In fact, most of us who write patches hope that they become part of the official source code ("getting them into trunk"). However, that depends on the developers' accepting them, so, as you say, it's just a possibility.
_Robbie_
Engineer
Engineer
Posts: 49
Joined: 23 Feb 2008 09:52
Location: Norway

How to apply a patch/diff file?

Post by _Robbie_ »

Hello everyone!

I've been lurking on these forums for several months now, but I feel it's time for me to join the community, as I have my first problem with OpenTTD. A problem with compiling. I've got a notebook with Ubuntu 7.10 installed. Now, this is what I do:
1. I download OpenTTD source, r12179 to be precise, and unpack it.
2. I apply Gonozal's patch with "patch -p0 < gonozal_patch_r12180.patch"
3. So far it goes without any problems. Now it's time to begin compiling. I begin with "./configure". It ends after generating makefile, but when I look through what it did, I see these lines among others:

Code: Select all

checking SDL... not found
checking COCOA... not OSX, skipping
checking GDI video driver... not Windows, skipping
WARNING: no video driver found, building dedicated only
checking dedicated... found
checking network... found
Then I compile it with "make". After it's done, I try to run it and, not so surprisingly, it doesn't do anything.
It looks like something is incomptible with my video driver. I have Radeon Xpress 200M and I'm using fglrx, version 8.452.1. If you need more informations, jusk ask. I'm neither Linux nor C(++) expert, so I might have problems doing anything advanced, but I'll gladly learn something new, if necessary.

Thank you for your time,
Robbie
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: How to apply a patch/diff file?

Post by cirdan »

Welcome to the forums.

You seem to be lacking SDL support in your system. As you are using a distribution, I assume that, even if you installed the actual SDL libraries, you didn't install the development headers, which are required to compile code against the libraries. The configure script detects this, and tells you so ("no video driver found"), but lets you go on, only that you will be building a "dedicated server", which cannot be used to actually play the game.

Check the documentation that came with your distribution to see how to install the missing packages. They should be called "SDL" and "SDL-devel", or similar; you need both of them installed to compile OpenTTD.
_Robbie_
Engineer
Engineer
Posts: 49
Joined: 23 Feb 2008 09:52
Location: Norway

Re: Howto apply a patch/diff file

Post by _Robbie_ »

Thank you for help, Cirdan!
You were right. After installing a package named "libsdl1.2-dev" everything is running smoothly.
Robbie
User avatar
TGVfan
Engineer
Engineer
Posts: 121
Joined: 10 Oct 2003 19:52
Location: Almere, greater Amsterdam

Re: Howto apply a patch/diff file

Post by TGVfan »

Starting to get angry and it won't take long begore this PC will get some flying lessons.
I have no clue what I'm doing wrong.

Downloaded the sourcefiles, and the tortoise SVN , but what then? I'm quite new to this and I start to understand that I don't understand anything of it at all..... :mrgreen:

What I have now:
Map with OTTD
Map with sourcefile
some patches... like the yapp/PBS

Please tell me how to get things working as I start to get mad.
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

What was the last step you performed successfully, and what error messages are generated when you attempt the following step?
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
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 35 guests