Howto apply a patch/diff file
Moderator: OpenTTD Developers
Re: Howto apply a patch/diff file
You should probably create the directory /usr/src first
Re: Howto apply a patch/diff file
Yep, that helped. Strange. I'll update the wiki to note that. NEXT ISSUE:
It appears that zlib-1.2.3 is no longer available from zlib.net (current version is 1.2.5). And the script is specifically looking for that version. I don't see an updated script on mingw's page either. Any idea what to do from here? I figured maybe editing the mingwPORT.ini file with the latest version would do it, but it appears everything is still failing at input line 4, so I'm at a loss now.
Code: Select all
Administrator@KAM-GIGABYTE /home/zlib-1.2.3/mingwPORT
$ ./mingwPORT.sh
Download file? (Yes)
Download file URI? (http://www.zlib.net)
Archive file type?
0) unknown
1) tar.gz
2) tgz
3) tar.bz2
4) tbz2
5) zip
Select a numeric value: (3)
Archive file? (zlib-1.2.3.tar.bz2)
Download to path? (/tmp)
Source path? (/usr/src/zlib-1.2.3)
Installation directory? (/mingw)
CFLAGS (-O3 -s -mms-bitfields -march=i686)
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = c:\tools\gnu\coreutils/etc/wgetrc
--2010-05-10 18:52:54-- http://www.zlib.net/zlib-1.2.3.tar.bz2
Resolving www.zlib.net... 69.73.181.135
Connecting to www.zlib.net|69.73.181.135|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2010-05-10 18:52:54 ERROR 404: Not Found.
tar (child): /tmp/zlib-1.2.3.tar.bz2: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u3pr zlib-1.2.3/win32/Makefile.gcc zlib-1.2.3-mingwPORT/win32/Makefile.gcc
|--- zlib-1.2.3/win32/Makefile.gcc Fri Aug 1 23:49:00 2003
|+++ zlib-1.2.3-mingwPORT/win32/Makefile.gcc Wed Feb 1 11:48:04 2006
--------------------------
No file to patch. Skipping patch.
3 out of 3 hunks ignored
/usr/src/zlib-1.2.3
make: win32/Makefile.gcc: No such file or directory
make: *** No rule to make target `win32/Makefile.gcc'. Stop.
make: win32/Makefile.gcc: No such file or directory
make: *** No rule to make target `win32/Makefile.gcc'. Stop.
make: win32/Makefile.gcc: No such file or directory
make: *** No rule to make target `win32/Makefile.gcc'. Stop.
Administrator@KAM-GIGABYTE /home/zlib-1.2.3/mingwPORT
$
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
-
- Engineer
- Posts: 2
- Joined: 23 May 2010 10:25
Re: Howto apply a patch/diff file
Hi, does anyone know how to install a patch on a mac? For example the chunnels patch. I've looked through all the wikis and they haven't helped at all! Can anyone explain please?
Thanks:)
Thanks:)
Re: Howto apply a patch/diff file
The first post of this topic has been written by the former Mac OS X porter/developer, so whatever is written there should also apply to Mac OS X.
-
- Engineer
- Posts: 2
- Joined: 23 May 2010 10:25
Re: Howto apply a patch/diff file
Ok thanks 

Re: Howto apply a patch/diff file
I have trouble getting my personal .bat to function correctly, either it cant find the file, or subversion claims -p is not a valid option charecter
also tried
It just wont work...
(win 7 32bit)
Code: Select all
subversion patch -p0 -i mestool.diff
Code: Select all
subversion patch -p0 < mestool.diff
It just wont work...
(win 7 32bit)
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Howto apply a patch/diff file
subversion and patch are different programmes.
try without the 'subversion' part.
try without the 'subversion' part.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Howto apply a patch/diff file
Forgot to add im using svn.exe, so not sure if i need something else?
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Howto apply a patch/diff file
How else can I phrase that? Subversion won't help you with patching a single bit.planetmaker wrote:subversion and patch are different programmes.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Howto apply a patch/diff file
eh, my bad for not reading that proberly, i'll try 

Re: Howto apply a patch/diff file
I want to try out some patches nevertheless I hadn't the courage to do that yet. For example, the daylength-patch. As advised by the wiki and the tutorials around here, I installed TortoiseSVN on my Windows 7 32bit OS and checked the latest OpenTTD-version out. Then I downloaded the patches and tried to apply them by using TortoiseSVN - but nothing happened (I followed the instructions on page 1 of this thread). Afterwards I read about a difference between SVN type and HG/GIT type patches - and the daylength-patch isn't obviously a SVN one. So how do I apply it anyway? The wikipage only describes the way by using TortoiseSVN or with the console for Linux users.
Edit: I'm not talking about compiling - just how to apply a HG/GIT type patch.
Edit#2: Done.
Edit: I'm not talking about compiling - just how to apply a HG/GIT type patch.
Edit#2: Done.
Quintus.
Re: Howto apply a patch/diff file
how didi u do id? i am encountering the same problem atm
Re: Howto apply a patch/diff file
Use -p1 instead of -p0 when running patch.
Re: Howto apply a patch/diff file
That's with a normal patch program, but Eonwe is asking how to do it with TortoiseSVN.Gremnon wrote:Use -p1 instead of -p0 when running patch.
(I don't know, unfortunately)
Re: Howto apply a patch/diff file
In that case, it can be solved by editing the .patch/diff file directly. Usually, I've found mercurial and git patches often have 'a/src...' and 'b/src...' instead of the normal lines, and by removing the a/ and b/ lines from it, it can be applied as per normal.
I've found one or two cases where it didn't work as expected even then, but it usually fixes it.
I've found one or two cases where it didn't work as expected even then, but it usually fixes it.
Re: Howto apply a patch/diff file
hooray, i managed to compile OpenTTD with MinGW.. now I have a pile of patches (daylength, cargodist etc).. how cna i do that? tortoisesvn apparently works differently from the description on the first page, maybe its updated?
whats to do next?
edit: oh no, it still works the same.. it seems i have the same problem with the a/ and b/ lines.. i removed the +++ line and the --- line but there is another line at the very top, do i remove that aswell? i tried that but i can never apply a patch with tortoise, if i choose .diff file and the trunk directory and click "ok" nothing happens, that small window never opens :<
edit 2: right, i managed to edit the file to make it a svn patch, so i was able to use it with tortoisesvn (it was outdated tho, but thats another thing)
anyways, do i really need to go through ALL the cargodist git files and change the code to make them svn and that everytime i update cargodist?
whats to do next?
edit: oh no, it still works the same.. it seems i have the same problem with the a/ and b/ lines.. i removed the +++ line and the --- line but there is another line at the very top, do i remove that aswell? i tried that but i can never apply a patch with tortoise, if i choose .diff file and the trunk directory and click "ok" nothing happens, that small window never opens :<
edit 2: right, i managed to edit the file to make it a svn patch, so i was able to use it with tortoisesvn (it was outdated tho, but thats another thing)
anyways, do i really need to go through ALL the cargodist git files and change the code to make them svn and that everytime i update cargodist?

Re: Howto apply a patch/diff file
Yes, unless you apply the patch from the console.AppeL wrote: anyways, do i really need to go through ALL the cargodist git files and change the code to make them svn and that everytime i update cargodist?![]()
In that case you use "patch -p1 < patch.diff" as command.
"patch -p0" is for svn patches.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
-
- Engineer
- Posts: 32
- Joined: 05 May 2010 09:38
Re: Howto apply a patch/diff file
Possibly seemingly obvious question, but not to me.
If i want to start compiling OTTD myself which of the instructions should i be using from here
http://wiki.openttd.org/Category:Compiling_OpenTTD
I assume i need to mention i am using windows XP as that will have some barring on which i use.
It would be useful for complete noobs like me if it pointed out somewhere which guide was appropriate for which operating system.
If i want to start compiling OTTD myself which of the instructions should i be using from here
http://wiki.openttd.org/Category:Compiling_OpenTTD
I assume i need to mention i am using windows XP as that will have some barring on which i use.
It would be useful for complete noobs like me if it pointed out somewhere which guide was appropriate for which operating system.

Re: Howto apply a patch/diff file
is that possible in windows or only linux?ChillCore wrote:Yes, unless you apply the patch from the console.AppeL wrote: anyways, do i really need to go through ALL the cargodist git files and change the code to make them svn and that everytime i update cargodist?![]()
In that case you use "patch -p1 < patch.diff" as command.
"patch -p0" is for svn patches.
Re: Howto apply a patch/diff file
patch.exe is included in mingw/msys, with this it works on windows as well
Who is online
Users browsing this forum: No registered users and 22 guests