Common Problems
UNIX vs. Windows end-of-line encoding
Text files originating from UNIX systems use a single linefeed character (LF) to mark the end of a line, whereas Windows systems use a carriage return followed by a linefeed (CRLF).
The GnuWin32 patch program may crash on a patchfile with Unix end-of-line encoding throwing the error "Assertion failed: hunk, file [path]/patch.c, line 339".
Most patches downloaded from projectpier.org are UNIX text files. When you use patch on Windows, you need to convert line-endings using a unix2dos utility or a decent text-editor.
One way to do this is to open the file with WORDPAD, choose "Save as" and select as type Text document.
Patch can't find the target file
This usually means that you are either executing patch in the wrong directory or that the patch was made relative to another directory. Open the patchfile and locate the lines describing the changed files to determine the path:
--- modules/codefilter/codefilter.module Tue Mar 28 15:04:48 2006
+++ modules/codefilter/codefilter.module Sun Apr 23 15:51:32 2006The above patch appears to be made relative to the projectpier root directory so you can execute the following command from the ProjectPier root:
patch -p0 < file.patchThe number after -p determines the number of path elements that should be ignored. This is very useful when you need to apply a patch that was made against an old and new directory:
--- olddir/modules/codefilter/codefilter.module Tue Mar 28 15:04:48 2006
+++ newdir/modules/codefilter/codefilter.module Sun Apr 23 15:51:32 2006You can apply this patch from the ProjectPier root by stripping the first path element; 'olddir' / 'newdir':
patch -p1 < file.patch