delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/16/04:05:30

X-Spam-Check-By: sourceware.org
Message-ID: <43A2834A.8000900@student.lu.se>
Date: Fri, 16 Dec 2005 10:05:14 +0100
From: Lennart Borgman <lennart DOT borgman DOT 073 AT student DOT lu DOT se>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT gnu DOT org>
CC: dave DOT korn AT artimi DOT com, cygwin AT cygwin DOT com
Subject: Re: Patch and Cygwin
References: <SERRANOMu3QTYCrtU2b00000042 AT SERRANO DOT CAM DOT ARTIMI DOT COM> <43A1ACC1 DOT 9090805 AT student DOT lu DOT se> <43A1B2A1 DOT 2020907 AT student DOT lu DOT se> <43A20542 DOT 1050405 AT student DOT lu DOT se> <uoe3hphdk DOT fsf AT gnu DOT org>
In-Reply-To: <uoe3hphdk.fsf@gnu.org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

Eli Zaretskii wrote:

>>The result is that the only option that seems to be able to handle the 
>>mix of line endings is Cygwin using DOS line endings with patch 2.5.9. 
>>(The only thing that did not work was preservation of line endings in 
>>the patched file, but that seems to be a small problem here.)
>>
>>To see more of the result see here: 
>>http://ourcomments.org/GNU/patchcrlf/readme.txt
>>    
>>
>
>I don't use Cygwin, but I tried your tests with the GnuWin32 ports of
>Diff and Patch (and `cat' from GnuWin32 port of Coreutils), and the
>tests worked for me as I expected.  Here are the results:
>
>    D:\gnu\patches>gnuwin32-test.cmd
>    D:\gnu\patches\tempGNUWIN32
>
>    D:/usr/bin/diff.EXE
>    D:/usr/bin/patch.EXE
>
>    patching file file-lf.txt
>    patching file file-cr-lf.txt
>
>    **** PATCHED file-cr-lf.txt: ********
>    This is a test comparing two files^M
>    with different line endings.^M
>    the name of this file is file-lf.txt^M
>    and it has lf line ending.^M
>    No this is diffed against the other file^M
>    using GnuWin32 diff.^M
>
>    **** PATCHED file-lf.txt: ***********
>    This is a test comparing two files^M
>    with different line endings.^M
>    the name of this file is file-cr-lf.txt^M
>    and it has cr-lf line ending.^M
>    No this is diffed against the other file^M
>    using GnuWin32 diff.^M
>
>    **** THE PATCH: ***********
>    3,4c3,4^M
>    < the name of this file is file-lf.txt^M
>    < and it has lf line ending.^M
>    ---^M
>    > the name of this file is file-cr-lf.txt^M
>    > and it has cr-lf line ending.^M
>
>    D:\gnu\patches>
>
>I think this is the result you expected.  Is that true?
>  
>
I think so. The file file-lf.txt has CRLF line endings after patching, 
otherwise everything is fine. But this is just one of the tests for 
GnuWin32. Please run all-cmd-tests.cmd and then checkresults.sh (in 
whatever sh you have).

>If you wanted the patched file-lf.txt to retain its Unix-style EOL
>format, then gnuwun32-test.cmd should be modified to say
>
>    patch --binary file-lf.txt temp.diff
>
>instead of
>
>    patch file-lf.txt temp.diff
>
>and then Patch will remove the CR characters from the patch file
>temp.diff and produce a LF-only EOLs:
>  
>
Thanks for the suggestion, but maybe you are misunderstanding me. I want 
this to work for all the test cases, not just for one of them.

>The files on your site indicate that the GnuWin32 test failed, but I
>think this is because you used a port of Diff that is not the GnuWin32
>port.
>  
>
Why do you think that? I have written in the readme.txt file what 
version of diff I believe am using. I have tried to be rather careful here.

If you run all-cmd-tests.cmd and then checkresults.sh do you get 
different results from those I got?

>(Btw, when I downloaded file-cr-lf.txt from your site by
>right-clicking on it and selecting "Save target as...", it wound up on
>my machine with Unix-style LF-only EOLs.  So I'm afraid some people
>that will try your tests might get incorrect results if they are not
>careful enough to convert file-cr-lf.txt to DOS EOL format first.
>Caveat emptor!)
>  
>
Oh thanks! I forgot to upload this file as binary.

In the sh-tests I have added tests for line ending style for 
file-cr-lf.txt and file-lf.txt. I will find out a way to do that for the 
GnuWin32 tests too.

--
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