From owner-freebsd-doc@FreeBSD.ORG Fri Aug 6 23:29:42 2004 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1252F16A4CE for ; Fri, 6 Aug 2004 23:29:42 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18F7943D31 for ; Fri, 6 Aug 2004 23:29:41 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-b202.otenet.gr [212.205.244.210]) i76NTbBr026660; Sat, 7 Aug 2004 02:29:38 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i76NTIfH095516; Sat, 7 Aug 2004 02:29:18 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i76NTIH2095515; Sat, 7 Aug 2004 02:29:18 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Sat, 7 Aug 2004 02:29:18 +0300 From: Giorgos Keramidas To: Peter Pentchev Message-ID: <20040806232918.GC79083@gothmog.gr> References: <200408061550.i76FoTY1013972@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200408061550.i76FoTY1013972@freefall.freebsd.org> cc: freebsd-doc@freebsd.org 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 List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2004 23:29:42 -0000 Nice :) xargs is one of my favorite UNIX tools too. If this builds fine (I haven't tested it, just gave it a quick look), then please commit it. On 2004-08-06 15:50, Peter Pentchev wrote: > Or how about the following, which uses the &windows; entity properly? :) > > G'luck, > Peter > > Index: doc/en_US.ISO8859-1/books/porters-handbook/book.sgml > =================================================================== > RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v > retrieving revision 1.470 > diff -u -r1.470 book.sgml > --- doc/en_US.ISO8859-1/books/porters-handbook/book.sgml 5 Aug 2004 10:04:30 -0000 1.470 > +++ doc/en_US.ISO8859-1/books/porters-handbook/book.sgml 6 Aug 2004 15:40:46 -0000 > @@ -18,6 +18,8 @@ > %mailing-lists; > > %freebsd; > + > +%trademarks; > > %urls; > ]> > @@ -682,6 +684,25 @@ > lines!); define USE_AUTOCONF_VER=213 and take the > diffs of configure.in. > > + Quite often, there is a situation when the software being > + ported, especially if it is primarily developed on &windows;, uses > + the CR/LF convention for most of its source files. This may cause > + problems with further patching, compiler warnings, scripts > + 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)" -print0 | \ > + ${XARGS} -0 ${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