diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | tests/generate.awk | 15 |
2 files changed, 12 insertions, 7 deletions
@@ -1,5 +1,9 @@ 2009-03-13 Eric Blake <ebb9@byu.net> + Fix awk script portability. + * checks/get-them: In gsub, properly escape {. + Reported by Gary V. Vaughan. + Make bootstrap easier on Solaris. * bootstrap: Add GNULIB_SRCDIR. Useful when a wrapper script gnulib-tool exists earlier on the path to work around /bin/sh diff --git a/tests/generate.awk b/tests/generate.awk index 538dc096..f4e782e0 100755 --- a/tests/generate.awk +++ b/tests/generate.awk @@ -1,6 +1,6 @@ # Extract all examples from the manual source. -*- AWK -*- -# Copyright (C) 1992, 2000, 2001, 2006, 2007, 2008 Free Software +# Copyright (C) 1992, 2000, 2001, 2006, 2007, 2008, 2009 Free Software # Foundation, Inc. # # This file is part of GNU M4. @@ -28,7 +28,8 @@ BEGIN { # I don't know how to get this file's name, so it's hard coded :( print "# Do not edit by hand, it was generated by generate.awk."; print "#"; - print "# Copyright (C) 1992, 2000, 2001, 2006 Free Software Foundation, Inc."; + print "# Copyright (C) 1992, 2000, 2001, 2006, 2007, 2008, 2009 Free"; + print "# Software Foundation, Inc."; print ; print "AT_BANNER([Documentation examples.])"; print ; @@ -134,13 +135,13 @@ function normalize(contents, i, lines, n, line, res) { for (i = 1; i < n; ++i) { line = lines[i]; - gsub (/^@result\{\}/, "", line); - gsub (/^@error\{\}/, "", line); + gsub ("^@result[{]}", "", line); + gsub ("^@error[{]}", "", line); gsub ("@[{]", "{", line); gsub ("@}", "}", line); gsub ("@@", "@", line); - gsub ("@tabchar{}", "\t", line); - gsub ("@w{ }", " @\\&t@", line); + gsub ("@tabchar[{]}", "\t", line); + gsub ("@w[{] }", " @\\&t@", line); gsub ("m4_", "m@\\&t@4_", line); # Some of the examples have improperly balanced square brackets. @@ -154,7 +155,7 @@ function normalize(contents, i, lines, n, line, res) { function new_group(node) { banner = node ". "; - gsub (/./, "-", banner); + gsub (".", "-", banner); printf ("\n\n"); printf ("## %s ##\n", banner); printf ("## %s. ##\n", node); |