delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/09/06/17:23:11

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Sat, 6 Sep 2003 17:22:37 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Volker Quetschke <quetschke AT scytek DOT de>
cc: cygwin AT cygwin DOT com
Subject: Re: Problem with patch 2.5.8-7
In-Reply-To: <3F5A49F3.1090702@scytek.de>
Message-ID: <Pine.GSO.4.56.0309061713070.7348@slinky.cs.nyu.edu>
References: <3F59F7DB DOT 6070403 AT scytek DOT de> <20030906201216 DOT GT1859 AT cygbert DOT vinschen DOT de>
<3F5A49F3 DOT 1090702 AT scytek DOT de>
Importance: Normal
MIME-Version: 1.0

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 AT 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 AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019