View | Details | Raw Unified | Return to bug 69086
Collapse All | Expand All

(-)book.sgml (+18 lines)
Lines 681-686 Link Here
681
	  lines!); define <literal>USE_AUTOCONF_VER=213</literal> and take the
681
	  lines!); define <literal>USE_AUTOCONF_VER=213</literal> and take the
682
	  diffs of <filename>configure.in</filename>.</para>
682
	  diffs of <filename>configure.in</filename>.</para>
683
683
684
	<para>Quite often, there is a situation when ported software, being
685
	  primarily developed on Windows, uses CR/LF convention for most of its
686
	  source files.  This may cause problems with further patching, compiler
687
	  warnings, scipts execution (<command>/bin/sh^M</command> not found),
688
	  etc.  To quickly convert those files from CR/LF to just LF, you can do
689
	  something like this:</para>
690
691
	<programlisting>USE_REINPLACE=	yes
692
693
post-extract:
694
	@${FIND} -E ${WRKDIR} -type f -iregex ".*\.(c|cpp|h|txt)" \
695
		-exec ${REINPLACE_CMD} -e 's/[[:cntrl:]]*$$//' '{}' \;</programlisting>
696
697
	<para>Of course, if you need to process each and every file,
698
	  <option>-iregex</option> above can be omitted.  Be aware that this
699
	  piece of code will strip all trailing control characters from each
700
	  line of processed file (except <literal>\n</literal>).</para>
701
684
	<para>Also, if you had to delete a file, then you can do it in the
702
	<para>Also, if you had to delete a file, then you can do it in the
685
	  <maketarget>post-extract</maketarget> target rather than as part of
703
	  <maketarget>post-extract</maketarget> target rather than as part of
686
	  the patch.  Once you are happy with the resulting diff, please split
704
	  the patch.  Once you are happy with the resulting diff, please split

Return to bug 69086