This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Put refpurposes one line for easy manpage generation.


Hi Andrew,

On Thu, 2008-04-03 at 10:39 -0400, Andrew Cagney wrote:
> I'm not fluent in XML either, however I still managed to hack up the 
> attached (from htdocs/bugzilla).  Can we do something with that?

Yes, you probably could. Note that all the rest of the manpage index
generation is done with sed. You might need to replace all of that. But
I wouldn't put too much work into it unless you really want to. It does
work pretty well as is now.

I did add a quick detection of refpurpose tags that aren't on one line
to the Makefile. So when you do make manpages it immediately points them
out. It found two other occurrences which I also fixed.

    frysk-common/ChangeLog
    2008-04-03  Mark Wielaard  <mwielaard@redhat.com>
    
       * manpages.sh: Catch bad refpurpose tags.
    
    frysk-core/frysk/pkglibdir/ChangeLog
    2008-04-03  Mark Wielaard  <mwielaard@redhat.com>
    
       * funit-procmask.xml: Put refpurpose on one line by itself.
       * funit-exit.xml: Likewise.
    
    frysk-top/ChangeLog
    2008-04-03  Mark Wielaard  <mwielaard@redhat.com>
    
       * Makefile.am (manpages): Check for refpurpose errors.

Now all tools mentioned on http://sourceware.org/frysk/manpages/ have a
proper description.

Cheers,

Mark
diff --git a/frysk-common/manpages.sh b/frysk-common/manpages.sh
index 63c1168..ac0c0b6 100755
--- a/frysk-common/manpages.sh
+++ b/frysk-common/manpages.sh
@@ -83,7 +83,10 @@ EOF
 	cat <<EOF
 <li><tt><a href="${name}.${n}.html">${name}.${n}</a></tt>
 EOF
-	sed -n 's/<refpurpose>\(.*\)<\/refpurpose>/\1/ p' $xmlfile
+	# Catch empty (aka not on one line) refpurpose tags.
+	desc=$(sed -n 's/<refpurpose>\(.*\)<\/refpurpose>/\1/ p' $xmlfile)
+	if test -z "$desc"; then exit 1; fi
+	echo "$desc"
 	echo "</li>"
     fi
 done
diff --git a/frysk-core/frysk/pkglibdir/funit-exit.xml b/frysk-core/frysk/pkglibdir/funit-exit.xml
index c442d85..d420b15 100644
--- a/frysk-core/frysk/pkglibdir/funit-exit.xml
+++ b/frysk-core/frysk/pkglibdir/funit-exit.xml
@@ -61,8 +61,8 @@
   </refmeta>
 
   <refnamediv>
-    <refname>funit-exit</refname> <refpurpose>exits with specified
-    status, or terminates with the specified signal</refpurpose>
+    <refname>funit-exit</refname>
+    <refpurpose>exits with specified status, or terminates with the specified signal</refpurpose>
   </refnamediv>
   
   <refsynopsisdiv>
diff --git a/frysk-sys/frysk/pkglibdir/funit-procmask.xml b/frysk-sys/frysk/pkglibdir/funit-procmask.xml
index 933b147..add4d7b 100644
--- a/frysk-sys/frysk/pkglibdir/funit-procmask.xml
+++ b/frysk-sys/frysk/pkglibdir/funit-procmask.xml
@@ -62,8 +62,7 @@
 
   <refnamediv>
     <refname>funit-procmask</refname>
-    <refpurpose>Test the processes signal mask for the presence (or
-    absence) of a list if signals</refpurpose>
+    <refpurpose>Test the processes signal mask for the presence (or absence) of a list if signals</refpurpose>
   </refnamediv>
   
   <refsynopsisdiv>
diff --git a/frysk-top/Makefile.am b/frysk-top/Makefile.am
index 6c45b4b..9f6a8c8 100644
--- a/frysk-top/Makefile.am
+++ b/frysk-top/Makefile.am
@@ -88,7 +88,8 @@ manpages manpages/index.html:
 		-"GNOME Interface" \
 		$(srcdir)/frysk-gui/frysk/bindir/*.xml \
 		-"Test framework" \
-		$(srcdir)/*/frysk/pkglibdir/*.xml
+		$(srcdir)/*/frysk/pkglibdir/*.xml \
+	    || (echo "Bad [not on one line] refpurpose tag found."; exit 1)
 	mv manpages/index.new manpages/index.html
 
 # Generate JAVADOC documentation.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]