delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/16/06:25:03

X-Spam-Check-By: sourceware.org
Date: Fri, 16 Dec 2005 13:24:31 +0200
Message-Id: <ud5jxp9n4.fsf@gnu.org>
From: Eli Zaretskii <eliz AT gnu DOT org>
To: Lennart Borgman <lennart DOT borgman DOT 073 AT student DOT lu DOT se>
CC: dave DOT korn AT artimi DOT com, cygwin AT cygwin DOT com
In-reply-to: <43A2834A.8000900@student.lu.se> (message from Lennart Borgman on Fri, 16 Dec 2005 10:05:14 +0100)
Subject: Re: Patch and Cygwin
Reply-to: Eli Zaretskii <eliz AT gnu DOT org>
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> <43A2834A DOT 8000900 AT student DOT lu DOT se>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

> Date: Fri, 16 Dec 2005 10:05:14 +0100
> From: Lennart Borgman <lennart DOT borgman DOT 073 AT student DOT lu DOT se>
> CC: dave DOT korn AT artimi DOT com,  cygwin AT cygwin DOT com
> 
> I think so. The file file-lf.txt has CRLF line endings after patching, 
> otherwise everything is fine.

What's wrong with the patched file having CRLF on Windows?

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

The other test fails with Unix-style patch file temp.diff, unless you
use --binary switch to Patch, and with --binary it works only for
file-lf.txt.  Sounds like a bug in fseek in the Windows runtime used
by MinGW.

But why should I care about these strange combinations on Windows?
Why isn't it enough that patching Unix-style files with Unix-style
patch files works (using --binary) and preserves the EOL type, and
patching DOS-style files with DOS-style patch files also works?

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

Why the perfectionism?  If the usual cases work so well, why do we
want to insist on looking for trouble at all costs?

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

Because I can find no other explanation for the fact that the test
that failed for you worked for me.  Maybe you should try installing
all the utilities again, make sure what Diff and what Patch runs in
each command, and see whether gnuwin32-test.cmd indeed fails for you.

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

all-cmd-tests.cmd just runs gnuwin32-test.cmd and
gnuwin32-lf-patchfile.cmd; I ran those two by hand, and I already
described what they did.  I didn't run the shell scripts because
there's no GnuWin32 port of Bash, and because I didn't want to mix the
Diff/Patch issue with the shell behavior.

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

That will not be easy using the techniques you tried in sh-tests, I
suspect.  Perhaps "od -c" is a good start.

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