This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with patch 2.5.8-7


On Sat, 6 Sep 2003, Volker Quetschke wrote:

> Hi!
>
> >>I'm experiencing problems with the current patch program, version
> >>2.5.8-7. (System W2k, all binary mounts, Cygwin updated two hours ago.)
> >>
> >>With the attached two files the following command worked with
> >>previous versions of patch (still works if I go back to
> >>patch 2.5.8-3 (my last version))
> >>
> >>But now:
> >>$ patch -i dos_lineends.patch -b -p2
> >>fails.
> >>vc_common.mak is in: ./STLport-4.0/src/vc_common.mak
> >
> > So it fails.  Interesting.  I wonder *how* it fails though.
> > http://cygwin.com/problems.html
> Ok, I stepped into the usual trap. If it fails for me, it has to fail for
> you also :-(
>
> Details follow:
>
> $ ll
> total 4
> drwxrwxr-x+   3 q        none            0 Sep  6 22:42 STLport-4.0/
> -rwxrwxr-x    1 admins   none         3737 Sep  6 22:41 dos_lineends.patch*
> [q@lisi]/tmp/patchtest:{517}:
> $ patch -i dos_lineends.patch -b -p2
> patching file STLport-4.0/src/vc_common.mak
> Hunk #1 FAILED at 42.
> Hunk #2 FAILED at 53.
> Hunk #3 FAILED at 63.
> 3 out of 3 hunks FAILED -- saving rejects to file STLport-4.0/src/vc_common.mak.rej
>
> This time I attached the output of cygcheck -s -v -r.
>
> As a data point, if I do a
> $ dos2unix.exe STLport-4.0/src/vc_common.mak
> first, the patch applies cleanly, but this is wrong,
> both patch and file are DOS style files with 0D0A lineendings.
>
> > P.S.: I tried it and it works for me.
> It works if I use patch 2.5.8-3
>
> Volker

I've got a couple more data points.  As can be seen from the session
below, when the patch (and the file being patched) contains DOS line
endings throughout, patch misbehaves on both text and binary mounts.
FWIW, patch works fine if only the data lines in the patch have DOS line
endings.  Hope this helps.
	Igor

$ pwd
/tmp/patchtest
$ od -c source.patch
0000000   -   -   -       s   o   u   r   c   e   -   o   r   i   g  \t
0000020   2   0   0   3   -   0   9   -   0   6       1   7   :   0   7
0000040   :   4   0   .   0   0   0   0   0   0   0   0   0       -   0
0000060   4   0   0  \r  \n   +   +   +       s   o   u   r   c   e  \t
0000100   2   0   0   3   -   0   9   -   0   6       1   7   :   0   8
0000120   :   1   8   .   0   9   1   9   1   5   2   0   0       -   0
0000140   4   0   0  \r  \n   @   @       -   1       +   1   ,   2
0000160   @   @  \r  \n      \r  \n   +  \r  \n
0000172
$ mount -ufb c:/cygwin/tmp/patchtest /tmp/patchtest
$ mount | grep tmp
c:\cygwin\tmp\patchtest on /tmp/patchtest type user (binmode)
$ od -c source
0000000  \r  \n
0000002
$ patch -p0 < source.patch
(Stripping trailing CRs from patch.)
patching file source
Hunk #1 succeeded at 1 with fuzz 1.
$ od -c source
0000000  \r  \n  \n
0000003
$ cp -p source-orig source
$ mount -uft c:/cygwin/tmp/patchtest /tmp/patchtest
$ mount | grep tmp
c:\cygwin\tmp\patchtest on /tmp/patchtest type user (textmode)
$ od -c source
0000000  \r  \n
0000002
$ patch -p0 < source.patch
patching file source
$ od -c source
0000000  \n  \n
0000002
$

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]