unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Converting end of lines from CRLF to LF
@ 2009-12-13 18:13 A Soare
  2009-12-13 19:04 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: A Soare @ 2009-12-13 18:13 UTC (permalink / raw)
  To: emacs-devel

I had access to cvs for windows. I downloaded the sources of emacs, and I tried
to apply a patch on. My surprise was to see that absolutely all the patches
failed: hunk failed.

I debugged patch more than 20 hours to understand how it works. Finally, I did
understand: it failed to match the context lines in the destination files, as
the end of line did not match.

I tried to convert all the sources of emacs that were downloaded using a cvs on
Windows, so the lines finish in CRLF.

I tried to convert all the sources using a script like that

for i in `find`; do if test -d $if; then mkdir -p $i; else tr -d
 "\015" <$i >/e/$i;done

I created the new directory structure, but during dumping emacs, temacs returns
error in loading internationalization.

That means that tr deleted the character 0xd somewhere inside the file, apart
from end of line. It is impossible to detect in which file it deleted something
tha it should have not deleted.

Any idea about how to make this conversion?


Alin





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Converting end of lines from CRLF to LF
  2009-12-13 18:13 Converting end of lines from CRLF to LF A Soare
@ 2009-12-13 19:04 ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2009-12-13 19:04 UTC (permalink / raw)
  To: A Soare; +Cc: emacs-devel

> From: A Soare <alinsoar@voila.fr>
> Date: Sun, 13 Dec 2009 18:13:07 +0000 (UTC)
> 
> I had access to cvs for windows. I downloaded the sources of emacs, and I tried
> to apply a patch on. My surprise was to see that absolutely all the patches
> failed: hunk failed.
> 
> I debugged patch more than 20 hours to understand how it works. Finally, I did
> understand: it failed to match the context lines in the destination files, as
> the end of line did not match.
> 
> I tried to convert all the sources of emacs that were downloaded using a cvs on
> Windows, so the lines finish in CRLF.
> 
> I tried to convert all the sources using a script like that
> 
> for i in `find`; do if test -d $if; then mkdir -p $i; else tr -d
>  "\015" <$i >/e/$i;done
> 
> I created the new directory structure, but during dumping emacs, temacs returns
> error in loading internationalization.
> 
> That means that tr deleted the character 0xd somewhere inside the file, apart
> from end of line. It is impossible to detect in which file it deleted something
> tha it should have not deleted.
> 
> Any idea about how to make this conversion?

The only sane way is to checkout in binary mode:

   cvs ... co -kb emacs

Sadly, this means you will have to remove the entire tree you have and
checkout anew.

To apply patches after that, make sure the patch is also in Unix
format (e.g., by running the patch through dos2unix or some such), and
then invoke Patch with the --binary switch.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Converting end of lines from CRLF to LF
@ 2009-12-13 22:34 A. Soare
  0 siblings, 0 replies; 3+ messages in thread
From: A. Soare @ 2009-12-13 22:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs   Dev  [emacs-devel]



> > Any idea about how to make this conversion?
> 
> The only sane way is to checkout in binary mode:
> 
>    cvs ... co -kb emacs
> 
> Sadly, this means you will have to remove the entire tree you have and
> checkout anew.
> 
> To apply patches after that, make sure the patch is also in Unix
> format (e.g., by running the patch through dos2unix or some such), and
> then invoke Patch with the --binary switch.
> 


Thank you. I never use Windows, but I bought a radio modem Qualcomm, that has no driver for Linux. It works very well, and I can ue it even in th train. So  just for download, I have to use cvs for windows.


However, debugging the `patch` program was an interesting experiece.

Alin.


____________________________________________________

Venez faire le plein d’idées et remplir votre hotte de cadeaux sur http://evenementiel.voila.fr/Noel/







^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-13 22:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-13 18:13 Converting end of lines from CRLF to LF A Soare
2009-12-13 19:04 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2009-12-13 22:34 A. Soare

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).