From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4910 invoked by alias); 4 Apr 2008 08:32:30 -0000 Received: (qmail 4902 invoked by uid 22791); 4 Apr 2008 08:32:29 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (83.160.170.119) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 04 Apr 2008 08:31:53 +0000 Received: from [82.72.53.253] by gnu.wildebeest.org with esmtp (Exim 4.63) (envelope-from ) id 1JhhKu-0007ab-Dl; Fri, 04 Apr 2008 10:31:50 +0200 Subject: Re: Put refpurposes one line for easy manpage generation. From: Mark Wielaard To: Petr Machata Cc: Andrew Cagney , frysk In-Reply-To: <20080403222914.GA25866@hridell.englab.brq.redhat.com> References: <1207230707.4284.11.camel@localhost.localdomain> <47F4E516.4070000@redhat.com> <1207232684.4284.24.camel@localhost.localdomain> <47F4EC2C.7000707@redhat.com> <1207256480.3545.14.camel@cc1341701-a.deven1.ov.home.nl> <20080403222914.GA25866@hridell.englab.brq.redhat.com> Content-Type: multipart/mixed; boundary="=-+b3bu38MK/19dpXBVH0U" Date: Fri, 04 Apr 2008 09:16:00 -0000 Message-Id: <1207297907.3417.3.camel@cc1341701-a.deven1.ov.home.nl> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8) X-Spam-Score: -2.1 (--) X-Virus-Checked: Checked by ClamAV on sourceware.org X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00024.txt.bz2 --=-+b3bu38MK/19dpXBVH0U Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 1431 Hi Petr, On Fri, 2008-04-04 at 00:29 +0200, Petr Machata wrote: > While I agree xslt is the proper way, I also immediately know the sed > syntax. Nice! That works like a charm. I even changed a couple of files to have the tag embedded in other tags on the same line and split over several lines to test it out. All looks fine: http://sourceware.org/frysk/manpages. Committed as follows: frysk-common/ChangeLog 2008-04-04 Mark Wielaard Petr Machata * frysk.xml: Split refpurpose tag over multiple lines. * manpages.sh (refpurposegrep): New. (suffix): Use refpurposegrep. frysk-core/frysk/bindir/ChangeLog 2008-04-04 Mark Wielaard * fdebuginfo.xml: Put refpurpose tag on multiple lines. * fexe.xml: Likewise. * fmaps.xml: Likewise. frysk-core/frysk/pkglibdir/ChangeLog 2008-04-04 Mark Wielaard * funit-exit.xml: Put refpurpose tag on multiple lines. * fparser.xml: Likewise. frysk-sys/frysk/pkglibdir/ChangeLog 2008-04-04 Mark Wielaard * funit-procmask.xml: Put refpurpose tag on multiple lines. frysk-top/ChangeLog 2008-04-04 Mark Wielaard * Makefile.am (manpages): Clarify error message. Cheers, Mark --=-+b3bu38MK/19dpXBVH0U Content-Disposition: inline; filename=patch Content-Type: text/x-patch; name=patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 5147 diff --git a/frysk-common/frysk.xml b/frysk-common/frysk.xml index 404b014..8991af9 100644 --- a/frysk-common/frysk.xml +++ b/frysk-common/frysk.xml @@ -62,7 +62,8 @@ frysk - The Frysk Debugging, Tracing, and Monitoring Tool Suite + The Frysk Debugging, Tracing, and Monitoring + Tool Suite diff --git a/frysk-common/manpages.sh b/frysk-common/manpages.sh index ac0c0b6..c41513a 100755 --- a/frysk-common/manpages.sh +++ b/frysk-common/manpages.sh @@ -57,6 +57,24 @@ sed -n < ${template} \ # Generate the body for the man pages. +refpurposegrep=$(cat << EOF +//{ + :loop + /<\/refpurpose>/b break + N + b loop + + :break + s,^.*,, + s,.*$,, + s,\(^[[:space:]]*\|[[:space:]]*$\),,g + s,[[:space:]]\+, ,g + p + q +} +EOF +) + suffix= for xmlfile in "$@" ; do if expr x"${xmlfile}" : "x-" > /dev/null ; then @@ -84,7 +102,7 @@ EOF
  • ${name}.${n} EOF # Catch empty (aka not on one line) refpurpose tags. - desc=$(sed -n 's/\(.*\)<\/refpurpose>/\1/ p' $xmlfile) + desc=$(sed -n "$refpurposegrep" $xmlfile) if test -z "$desc"; then exit 1; fi echo "$desc" echo "
  • " diff --git a/frysk-core/frysk/bindir/fdebuginfo.xml b/frysk-core/frysk/bindir/fdebuginfo.xml index 3798c06..8f88f0b 100644 --- a/frysk-core/frysk/bindir/fdebuginfo.xml +++ b/frysk-core/frysk/bindir/fdebuginfo.xml @@ -70,7 +70,8 @@ fdebuginfo - display the debug-info paths for a process and its shared modules + display the debug-info paths for a process + and its shared modules diff --git a/frysk-core/frysk/bindir/ferror.xml b/frysk-core/frysk/bindir/ferror.xml index 6d4bc90..b8742b6 100644 --- a/frysk-core/frysk/bindir/ferror.xml +++ b/frysk-core/frysk/bindir/ferror.xml @@ -70,7 +70,8 @@ ferror - print a stack trace when the given message is printed by the traced program + print a stack trace when the given message is printed + by the traced program diff --git a/frysk-core/frysk/bindir/fmaps.xml b/frysk-core/frysk/bindir/fmaps.xml index 692967e..de7a3dd 100644 --- a/frysk-core/frysk/bindir/fmaps.xml +++ b/frysk-core/frysk/bindir/fmaps.xml @@ -69,9 +69,8 @@ - fmaps - print the process or a corefile's address maps. - + fmapsprint the process or a corefile's + address maps diff --git a/frysk-core/frysk/pkglibdir/fparser.xml b/frysk-core/frysk/pkglibdir/fparser.xml index 3635e45..352e330 100644 --- a/frysk-core/frysk/pkglibdir/fparser.xml +++ b/frysk-core/frysk/pkglibdir/fparser.xml @@ -62,7 +62,8 @@ fparser - Runs the frysk standalone source code parser utility. + runs the frysk standalone source code parser + utility diff --git a/frysk-core/frysk/pkglibdir/funit-exit.xml b/frysk-core/frysk/pkglibdir/funit-exit.xml index d420b15..513ab11 100644 --- a/frysk-core/frysk/pkglibdir/funit-exit.xml +++ b/frysk-core/frysk/pkglibdir/funit-exit.xml @@ -62,7 +62,8 @@ funit-exit - exits with specified status, or terminates with the specified signal + exits with specified status, + or terminates with the specified signal diff --git a/frysk-sys/frysk/pkglibdir/funit-procmask.xml b/frysk-sys/frysk/pkglibdir/funit-procmask.xml index add4d7b..9e82450 100644 --- a/frysk-sys/frysk/pkglibdir/funit-procmask.xml +++ b/frysk-sys/frysk/pkglibdir/funit-procmask.xml @@ -62,7 +62,8 @@ funit-procmask - Test the processes signal mask for the presence (or absence) of a list if signals + test the processes signal mask for the presence + (or absence) of a list if signals diff --git a/frysk-top/Makefile.am b/frysk-top/Makefile.am index 9f6a8c8..5a95c67 100644 --- a/frysk-top/Makefile.am +++ b/frysk-top/Makefile.am @@ -89,7 +89,7 @@ manpages manpages/index.html: $(srcdir)/frysk-gui/frysk/bindir/*.xml \ -"Test framework" \ $(srcdir)/*/frysk/pkglibdir/*.xml \ - || (echo "Bad [not on one line] refpurpose tag found."; exit 1) + || (echo "Bad xml file or no refpurpose tag found."; exit 1) mv manpages/index.new manpages/index.html # Generate JAVADOC documentation. --=-+b3bu38MK/19dpXBVH0U--