Applying a patch to source on Windows
Moderator: Forum Moderators
Applying a patch to source on Windows
I'm trying to apply the Machine Learning Recruiter patch to 1.11.1 on a Windows 8 machine, but I've run into some issues and I'm looking for help.
I'm using GnuWin32's copy of patch 2.5.9 for this action.
Anyone got any experience with this?
I'm using GnuWin32's copy of patch 2.5.9 for this action.
Code: Select all
c:\Users\Quitch\Downloads\wesnoth-1.11.1>"c:\Program Files (x86)\GnuWin32\bin\patch.exe" -p1 -i c:\users\quitch\Downloads\ML_Recruiter_0.4.patch
patching file RELEASE_NOTES
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
Re: Applying a patch to source on Windows
do you have TortoiseSVNinstalled? just right click on patch and select "apply patch"
Re: Applying a patch to source on Windows
That's not going to work with this particular one, I'm afraid (and anyways, Quitch seems to be working with the 1.11.1 tarball, not an SVN checkout). The problem might be that patch thinks that c:\Program Files (x86)\GnuWin32\bin\ is the working directory; try appending this to the command:do you have TortoiseSVNinstalled? just right click on patch and select "apply patch"
Code: Select all
-d c:\Users\Quitch\Downloads\wesnoth-1.11.1
Re: Applying a patch to source on Windows
Thanks for the suggestion, but alas it doesn't appear to work.
I also tried using TortoiseMerge from TortoiseGit to apply the patch, but get the error:
Code: Select all
c:\Users\Quitch\Downloads\wesnoth-1.11.1>"c:\Program Files (x86)\GnuWin32\bin\patch.exe" -p1 -i -d c:\users\Quitch\downloads\wesnoth-1.11.1 c:\users\Quitch\Downloads\ML_Recruiter_0.4.patch
c:\Program Files (x86)\GnuWin32\bin\patch.exe: **** File c:\users\Quitch\downloads\wesnoth-1.11.1 is not a regular file -- can't patch
c:\Users\Quitch\Downloads\wesnoth-1.11.1>"c:\Program Files (x86)\GnuWin32\bin\patch.exe" -p1 -i -d c:\users\Quitch\downloads\wesnoth-1.11.1\RELEASE_NOTES c:\users\Quitch\Downloads\ML_Recruiter_0.4.patch
patching file c:\users\Quitch\downloads\wesnoth-1.11.1\RELEASE_NOTES
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
c:\Users\Quitch\Downloads\wesnoth-1.11.1>"c:\Program Files (x86)\GnuWin32\bin\patch.exe" -p1 -i -d c:\users\Quitch\downloads\wesnoth-1.11.1 c:\users\Quitch\Downloads\ML_Recruiter_0.4.patch c:\users\Quitch\downloads\wesnoth-1.11.1
c:\Program Files (x86)\GnuWin32\bin\patch.exe: c:\users\Quitch\downloads\wesnoth-1.11.1: extra operand
c:\Program Files (x86)\GnuWin32\bin\patch.exe: Try `c:\Program Files (x86)\GnuWin32\bin\patch.exe --help' for more information.
Code: Select all
The patch seems outdated! The file line
and the patchline
[/list]
do not match!
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Applying a patch to source on Windows
Is that the case ? Does your source tree even contain version control information ? (a .svn or .git subdirectory, possibly hidden). I would be surprised if a vcs could do something useful when applying a patch in this case.lipk wrote:(and anyways, Quitch seems to be working with the 1.11.1 tarball, not an SVN checkout).
Also, git patches and svn patches are not exactly compatible (IIRC with some manual editing I transferred them in both directions).
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Applying a patch to source on Windows
That post lost me a little, so I should just state that the downloaded source has a hidden .git directory
Re: Applying a patch to source on Windows
Or just change the number of patch components to strip when applying the patch (Anonymissimus wrote:Also, git patches and svn patches are not exactly compatible (IIRC with some manual editing I transferred them in both directions).
-p
argument to patch
). For patches generated by svn diff
, you don’t strip any path components, whereas git
diffs require one path component to be stripped. Manual editing is not necessary.Example:
Code: Select all
$ patch -p0 < ~/svn-generated.diff
Code: Select all
$ patch -p1 < ~/git-generated.diff
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Re: Applying a patch to source on Windows
you could apply the patch manually, just open the .patch file in a text editor.
it contains a list of modified files. within a file it starts with some text lines before and after the change (makes it easier to find the right spot). '-' marks lines that got removed, '+' lines that were added.
there are four files that didn't exist before (those showing 'revision 0'), you have to create them.
it contains a list of modified files. within a file it starts with some text lines before and after the change (makes it easier to find the right spot). '-' marks lines that got removed, '+' lines that were added.
there are four files that didn't exist before (those showing 'revision 0'), you have to create them.