From owner-freebsd-ports@FreeBSD.ORG Sun Jul 31 17:32:01 2005 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB14216A41F for ; Sun, 31 Jul 2005 17:32:01 +0000 (GMT) (envelope-from pauls@utdallas.edu) Received: from mail.stovebolt.com (mail.stovebolt.com [66.221.101.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39B9843D46 for ; Sun, 31 Jul 2005 17:32:01 +0000 (GMT) (envelope-from pauls@utdallas.edu) Received: from [192.168.2.101] (adsl-65-71-93-204.dsl.rcsntx.swbell.net [65.71.93.204]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.stovebolt.com (Postfix) with ESMTP id 1C9433FC37 for ; Sun, 31 Jul 2005 12:31:55 -0500 (CDT) Date: Sun, 31 Jul 2005 12:31:33 -0500 From: Paul Schmehl To: ports@freebsd.org Message-ID: <27AB0C3B4FB62C0FC0F16B5B@Paul-Schmehls-Computer.local> In-Reply-To: <20050731141104.GC79524@isis.sigpipe.cz> References: <20050730092605.GB79432@isis.sigpipe.cz> <0B689B1DF466EF5C97989D7C@Paul-Schmehls-Computer.local> <20050731141104.GC79524@isis.sigpipe.cz> X-Mailer: Mulberry/4.0.0 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: Re: Fixing up man pages X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Paul Schmehl List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2005 17:32:01 -0000 --On July 31, 2005 4:11:04 PM +0200 Roman Neuhauser wrote: ># pauls@utdallas.edu / 2005-07-30 15:03:35 -0500: >> --On July 30, 2005 11:26:05 AM +0200 Roman Neuhauser >> wrote: >> >> I posted a question about the sed script in questions, and once I >> understood the guy's answer (which took a while), I got it working. >> >> Here's the working version: >> >> @${SED} -e '/man\.macros/r ${WRKSRC}/doc/man.macros' \ >> -e '/man\.macros/d' ${WRKSRC}/doc/${f} > ${WRKDIR}/${f} >> >> What this does is parse man.macros for the string man\.macros and, if >> found, use it as input to the second part that removes the string >> man\.macros from the input stream and then feeds it to the file ${f}, >> which is the manpage in the source. Once the macro is in the manpage, >> man can display it properly. > > That's incorrect. This is what it looks like again: > > ${SED} -e '/man\.macros/r ${WRKSRC}/doc/man.macros' > -e '/man\.macros/d' ${WRKSRC}/doc/${f} > ${WRKDIR}/${f} > > You need to remember that: > > 1. After any and all processing, sed prints each line of input > (stdin or an argument) to stdout unless told otherwise. > ("sed file" is just like "cat file" except dumb) > > 2. "sed -e 'cmd1' -e 'cmd2'" is the same as "sed -e "cmd1;cmd2". > > 3. The "r" command causes sed to "Copy the contents of file to > the standard output immediately before the next attempt to read a > line of input." (man page) > > 4. The "d" command causes sed to delete the currently processed line > and read the next one (but before that, sed passes through the > contents of man.macros as scheduled in step 3). > > The above detailed behavior results in every line of input replaced > with the contents of ${WRKSRC}/doc/man.macros. This is done for every > file in ${TOPD_DIR}/doc whose name ends in ".n", and the result is > saved in $(MAN_INSTALL_DIR)/`basename iwidgets_$$i` I hope it's a > comprehensible explanation. > It is, and I thank you for that. It makes a great deal of sense now. Paul Schmehl (pauls@utdallas.edu) Adjunct Information Security Officer University of Texas at Dallas AVIEN Founding Member http://www.utdallas.edu/