Date: Sun, 31 Jul 2005 12:31:33 -0500 From: Paul Schmehl <pauls@utdallas.edu> To: ports@freebsd.org Subject: Re: Fixing up man pages Message-ID: <27AB0C3B4FB62C0FC0F16B5B@Paul-Schmehls-Computer.local> In-Reply-To: <20050731141104.GC79524@isis.sigpipe.cz> References: <E6D983675FE91A2A73A73A10@Paul-Schmehls-Computer.local> <20050730092605.GB79432@isis.sigpipe.cz> <0B689B1DF466EF5C97989D7C@Paul-Schmehls-Computer.local> <20050731141104.GC79524@isis.sigpipe.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
--On July 31, 2005 4:11:04 PM +0200 Roman Neuhauser <neuhauser@sigpipe.cz> wrote: ># pauls@utdallas.edu / 2005-07-30 15:03:35 -0500: >> --On July 30, 2005 11:26:05 AM +0200 Roman Neuhauser >> <neuhauser@sigpipe.cz> 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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?27AB0C3B4FB62C0FC0F16B5B>