logo separator

[mkgmap-dev] Trouble applying patches

From Richard Hansen rhansen at bbn.com on Sat Feb 4 22:53:49 GMT 2012

On 2012-02-04 05:20, Gerd Petermann wrote:
> Hi Marko,
> 
> I tried to apply my patch
> boundary_prep_quadtree_v1.patch
> on the performance branch in my linux environment.
> I still wasn't able to do it :-(

There are a couple of issues with the patch:

 * It uses CRLF line endings.  GNU patch tries to be helpful by
converting to LF line endings.  Unfortunately, the files being patched
have CRLF line endings, so patch's helpfulness actually gets in the way.
 This can be worked around by using the '--binary' option when patching.

 * The last hunk is corrupt.  The hunk header contains:
      @@ -281,4 +281,154 @@
   which indicates that 150 new lines were added (154 minus 4).  There
are actually 151 new lines in the hunk, so either 154 should be 155 or
there's a stray line that should be deleted.

After editing the patch and changing that 154 to 155, I was able to
apply the patch on my Linux system using the following command:

    patch -p0 --binary <verify_boundary.patch

I like Marko's suggestion of running 'svn propset svn:eol-style native'
on all text files in the repository.  That will help avoid such problems
in the future.

-Richard



More information about the mkgmap-dev mailing list