FreeBSD Bugzilla – Attachment 44671 Details for
Bug 69086
Porters Handbook: How to convert from CR/LF to LF using REINPLACE_CMD
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.54 KB, created by
Alexey Dokuchaev
on 2004-07-15 08:00:44 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Alexey Dokuchaev
Created:
2004-07-15 08:00:44 UTC
Size:
1.54 KB
patch
obsolete
>Index: book.sgml >=================================================================== >RCS file: /home/pub/ftp/pub/FreeBSD/development/FreeBSD-CVS//doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v >retrieving revision 1.461 >diff -u -r1.461 book.sgml >--- book.sgml 12 Jul 2004 08:24:15 -0000 1.461 >+++ book.sgml 15 Jul 2004 06:55:26 -0000 >@@ -681,6 +681,24 @@ > lines!); define <literal>USE_AUTOCONF_VER=213</literal> and take the > diffs of <filename>configure.in</filename>.</para> > >+ <para>Quite often, there is a situation when ported software, being >+ primarily developed on Windows, uses CR/LF convention for most of its >+ source files. This may cause problems with further patching, compiler >+ warnings, scipts execution (<command>/bin/sh^M</command> not found), >+ etc. To quickly convert those files from CR/LF to just LF, you can do >+ something like this:</para> >+ >+ <programlisting>USE_REINPLACE= yes >+ >+post-extract: >+ @${FIND} -E ${WRKDIR} -type f -iregex ".*\.(c|cpp|h|txt)" \ >+ -exec ${REINPLACE_CMD} -e 's/[[:cntrl:]]*$$//' '{}' \;</programlisting> >+ >+ <para>Of course, if you need to process each and every file, >+ <option>-iregex</option> above can be omitted. Be aware that this >+ piece of code will strip all trailing control characters from each >+ line of processed file (except <literal>\n</literal>).</para> >+ > <para>Also, if you had to delete a file, then you can do it in the > <maketarget>post-extract</maketarget> target rather than as part of > the patch. Once you are happy with the resulting diff, please split
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 69086
: 44671