FW: [gpm]GPM doc problems with other awk's?

Mark Hymers markh@linuxfromscratch.org
Thu, 3 Jan 2002 20:07:55 +0000


On Thu, 03, Jan, 2002 at 12:36:51PM -0500, Jason Gurtz spoke thus..
> Hmm, back from vacation monday and still over a thousand emails to
> go....
> 
> Anyway, shall we try this?
I applied this and there were still one or two (very little)
gawk-specific things (one in the Makefile.in [therefore in the Makefile]
and one in the mktxt script).  I've attached a complete diff against
gpm-1.19.6 which includes Alessandro Rubini's changes to manpager.  This
*should* make gpm work with any awk (I think).

Note that it would probably be nicer to make configure find which awk is
used and use that instead of awk in doc/Makefile.in.  Unfortunately,
I've never used autoconf before in my life so I'll leave that to someone
else!

[I'm also sending a copy to the gpm list; I'm sending them seperately so
that when people follow up, they'll only go to the appropriate list]  

Mark

-- 
Mark Hymers					 BLFS Editor
markh@linuxfromscratch.org


diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in
--- gpm-1.19.6/doc/Makefile.in	Wed Oct  3 21:51:46 2001
+++ gpm-1.19.6-new/doc/Makefile.in	Thu Jan  3 19:50:41 2002
@@ -71,7 +71,7 @@
 all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES)
 
 $(MANPAGES): doc.gpm manpager
-	gawk -f ./manpager doc.gpm
+	awk -f ./manpager doc.gpm
 
 # why gpmdoc.ps and gpm.ps
 gpmdoc.ps:	gpm.ps
diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager
--- gpm-1.19.6/doc/manpager	Sun Sep 23 20:00:03 2001
+++ gpm-1.19.6-new/doc/manpager	Thu Jan  3 19:45:17 2002
@@ -1,6 +1,5 @@
-#! /usr/bin/gawk -f
-
-# Warning: this uses gnu-awk features
+#! /usr/bin/awk -f
+# Copyright (c) 1998-2001 Alessandro Rubini
 
 BEGIN {IN=0}
 
@@ -23,18 +22,32 @@
 
 	        { gsub("^%M ?",""); }
 
-# itz Wed Sep 30 10:28:58 PDT 1998
+# Use gensub for converting tags: itz Sep 30 1998
+#
+# However, the gensub function is gawk-specific, and we want things
+# to work with original-awk too (for portability).
+# Therefore, use a normal gsub, even though it's a subobptimal solution
+# as it may step in extra braces. The good solution will be piping to sed,
+# or match, extract subesxpression, replace, reinsert -- bleah...
+# (ARub, Oct 10 2000)
 /@b\{/ {
-  $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g");
+  #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g");
+  gsub("@b\{","\\fB");
+  gsub("\}","\\fP");
+} 
+
+/@var\{/ {
+  #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g");
+  gsub("@var\{","\\fB");
+  gsub("\}","\\fP");
 } 
 
 /@(samp|code|file)\{/ {
-  $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g");
+  #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g");
+  gsub("@(samp|code|file)\{","");
+  gsub("\}","");
 }
 
-/@var\{/ {
-  $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g");
-} 
 
 /@xref\{.*\}\./ {
   gsub(/@xref\{.*\}\./,"");
@@ -55,6 +68,7 @@
 		}
 
 /^@table/       { TABLE=1; }
+/^@itemize/     { TABLE=1; next}
 
 /^@item/        {
 	        gsub("^@item *","");
@@ -63,6 +77,7 @@
 		}
 
 /^@end table/   {TABLE=0}
+/^@end itemize/ {TABLE=0}
 
 # discard other texinfo commands
 
diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt
--- gpm-1.19.6/doc/mktxt	Sun Sep 23 20:00:03 2001
+++ gpm-1.19.6-new/doc/mktxt	Thu Jan  3 19:54:10 2002
@@ -1,6 +1,6 @@
-#! /usr/bin/gawk -f
+#! /usr/bin/awk -f
 
-# Warning: this may use gnu-awk features
+# This shouldn't contain any gawk specific features anymore 
 
 # Program to create ascii from info;
 # Missing: table of contents
@@ -29,7 +29,7 @@
 NODELINE==5  { printf "\t\t\t\t"; NODELINE=0}
 
 
-/^* Menu:$/  { KEEP=0 }
+/^\*\ Menu:$/  { KEEP=0 }