From owner-freebsd-doc@FreeBSD.ORG Sun Jul 18 02:10:27 2004 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57C2716A4CE for ; Sun, 18 Jul 2004 02:10:27 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33F6143D4C for ; Sun, 18 Jul 2004 02:10:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i6I2ARiZ031679 for ; Sun, 18 Jul 2004 02:10:27 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i6I2ARb6031678; Sun, 18 Jul 2004 02:10:27 GMT (envelope-from gnats) Date: Sun, 18 Jul 2004 02:10:27 GMT Message-Id: <200407180210.i6I2ARb6031678@freefall.freebsd.org> To: freebsd-doc@FreeBSD.org From: Giorgos Keramidas Subject: Re: docs/69086: Porters Handbook: How to convert from CR/LF to LF using REINPLACE_CMD X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Giorgos Keramidas List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2004 02:10:27 -0000 The following reply was made to PR docs/69086; it has been noted by GNATS. From: Giorgos Keramidas To: Alexey Dokuchaev , "David O'Brien" Cc: bug-followup@FreeBSD.org, freebsd-ports@FreeBSD.org Subject: Re: docs/69086: Porters Handbook: How to convert from CR/LF to LF using REINPLACE_CMD Date: Sun, 18 Jul 2004 05:04:00 +0300 On 2004-07-15 14:01, Alexey Dokuchaev wrote: > I therefore suggest including this in Porter's Handbook, as in > attached patch. This looks like a very nice way to filter the sources to me. I'm not very experienced with the way our ports system works though. Do the people on freebsd-ports agree about this change? In particular, since he seems to be the most active ports committer that updates the porters-handbook, does David O'Brien agree with this addition? > 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 USE_AUTOCONF_VER=213 and take the > diffs of configure.in. > > + 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 (/bin/sh^M not found), > + etc. To quickly convert those files from CR/LF to just LF, you can do > + something like this: > + > + USE_REINPLACE= yes > + > +post-extract: > + @${FIND} -E ${WRKDIR} -type f -iregex ".*\.(c|cpp|h|txt)" \ > + -exec ${REINPLACE_CMD} -e 's/[[:cntrl:]]*$$//' '{}' \; > + > + Of course, if you need to process each and every file, > + above can be omitted. Be aware that this > + piece of code will strip all trailing control characters from each > + line of processed file (except \n). > + > Also, if you had to delete a file, then you can do it in the > post-extract target rather than as part of > the patch. Once you are happy with the resulting diff, please split