autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.63b-41-


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.63b-41-g3bec0c1
Date: Fri, 24 Apr 2009 19:15:36 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=3bec0c1d32f56cfec6a9c78ddbed658b03863ae6

The branch, master has been updated
       via  3bec0c1d32f56cfec6a9c78ddbed658b03863ae6 (commit)
       via  8eb0f6220d92c34016e3efbbf30241a1d89c6517 (commit)
       via  5da9f24d5570dcdb6333a0678a1bdf2117c6e400 (commit)
       via  bcb6b3180d18993a286b12585d890e3bea6e8c37 (commit)
      from  f4e756e351c3ade42d1c1a5126d411936cfb6b51 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3bec0c1d32f56cfec6a9c78ddbed658b03863ae6
Author: Eric Blake <address@hidden>
Date:   Wed Apr 22 22:06:04 2009 -0600

    Fix quoting of m4 macros in AT_CHECK.
    
    * lib/autotest/general.m4 (AT_CHECK): Expand prior to adding
    escapes, to avoid shell syntax errors caused by late macro
    expansion.
    * NEWS: Document this change.
    * tests/autotest.at (Metacharacters in command from M4 expansion):
    New test.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 8eb0f6220d92c34016e3efbbf30241a1d89c6517
Author: Eric Blake <address@hidden>
Date:   Fri Apr 24 08:50:39 2009 -0600

    manual: Use consistent spelling of here-document.
    
    * doc/autoconf.texi (Defining Symbols, Programming in M4sh)
    (Common Shell Constructs, Macro Names, Writing Testsuites): Fix
    spelling.
    Reported by Ralf Wildenhues.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 5da9f24d5570dcdb6333a0678a1bdf2117c6e400
Author: Eric Blake <address@hidden>
Date:   Fri Apr 24 08:46:59 2009 -0600

    Make AT_CHECK_UNQUOTED more like AC_DEFINE_UNQUOTED.
    
    * lib/autotest/general.m4 (AT_CHECK_NOESCAPE): Keep older,
    undocumented semantics, where unbalanced " cannot be used in the
    stdout/stderr argument.
    (AT_CHECK_UNQUOTED): Treat " in stdout/stderr as a literal, since
    the text is used in double-quoted context.
    * tests/autotest.at (unquoted output): New test.
    * doc/autoconf.texi (Writing Testsuites) <AT_CHECK>: Mention which
    shell expansions are handled.
    
    Signed-off-by: Eric Blake <address@hidden>

commit bcb6b3180d18993a286b12585d890e3bea6e8c37
Author: Eric Blake <address@hidden>
Date:   Wed Apr 22 17:14:13 2009 -0600

    Rename AT_CHECK_NOESCAPE to AT_CHECK_UNQUOTED.
    
    * lib/autotest/general.m4 (AT_CHECK_NOESCAPE): Deprecate, in favor
    of new spelling...
    (AT_CHECK_UNQUOTED): ...for consistency with AC_DEFINE_UNQUOTED.
    * doc/autoconf.texi (Writing Testsuites) <AT_CHECK>: Document the
    rename.
    * NEWS: Likewise.
    * tests/autotest.at (Binary output, Cleanup): Adjust tests.
    * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
    Likewise.
    Reported by Ralf Wildenhues.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |   38 ++++++++++++++++++++++++++++++++++++++
 NEWS                    |    6 +++++-
 doc/autoconf.texi       |   30 ++++++++++++++++++------------
 lib/autotest/general.m4 |   21 +++++++++++++++------
 tests/autotest.at       |   21 +++++++++++++++++----
 tests/torture.at        |    4 ++--
 6 files changed, 95 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 93cf5f2..0c243ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2009-04-24  Eric Blake  <address@hidden>
+
+       Fix quoting of m4 macros in AT_CHECK.
+       * lib/autotest/general.m4 (AT_CHECK): Expand prior to adding
+       escapes, to avoid shell syntax errors caused by late macro
+       expansion.
+       * NEWS: Document this change.
+       * tests/autotest.at (Metacharacters in command from M4 expansion):
+       New test.
+
+       manual: Use consistent spelling of here-document.
+       * doc/autoconf.texi (Defining Symbols, Programming in M4sh)
+       (Common Shell Constructs, Macro Names, Writing Testsuites): Fix
+       spelling.
+       Reported by Ralf Wildenhues.
+
+       Make AT_CHECK_UNQUOTED more like AC_DEFINE_UNQUOTED.
+       * lib/autotest/general.m4 (AT_CHECK_NOESCAPE): Keep older,
+       undocumented semantics, where unbalanced " cannot be used in the
+       stdout/stderr argument.
+       (AT_CHECK_UNQUOTED): Treat " in stdout/stderr as a literal, since
+       the text is used in double-quoted context.
+       * tests/autotest.at (unquoted output): New test.
+       * doc/autoconf.texi (Writing Testsuites) <AT_CHECK>: Mention which
+       shell expansions are handled.
+
+       Rename AT_CHECK_NOESCAPE to AT_CHECK_UNQUOTED.
+       * lib/autotest/general.m4 (AT_CHECK_NOESCAPE): Deprecate, in favor
+       of new spelling...
+       (AT_CHECK_UNQUOTED): ...for consistency with AC_DEFINE_UNQUOTED.
+       * doc/autoconf.texi (Writing Testsuites) <AT_CHECK>: Document the
+       rename.
+       * NEWS: Likewise.
+       * tests/autotest.at (Binary output, Cleanup): Adjust tests.
+       * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
+       Likewise.
+       Reported by Ralf Wildenhues.
+
 2009-04-22  Ralf Wildenhues  <address@hidden>
 
        New test to ensure autom4te cache file locking works.
diff --git a/NEWS b/NEWS
index 107a10c..11466d6 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,9 @@ GNU Autoconf NEWS - User visible changes.
 ** Ensure AT_CHECK can support commands that include a # given with
    proper m4 quoting.  For shell comments, this is a new feature; for
    non-shell comments, this fixes a regression introduced in 2.63b.
+   Additionally, AT_CHECK correctly supplies shell escapes for
+   metacharacters occurring in m4 macro expansions within the expected
+   stdout and stderr parameters.
 
 ** The macro AT_CHECK now understands the concept of hard failure.  If
    a test exits with an unexpected status 99, cleanup actions for the
@@ -16,7 +19,8 @@ GNU Autoconf NEWS - User visible changes.
    of AT_XFAIL_IF.  It also understands the new directives
    ignore-nolog, stdout-nolog, and stderr-nolog.
 
-** The autotest macro AT_CHECK_NOESCAPE is now documented.
+** The following documented autotest macros are new:
+   AT_CHECK_UNQUOTED
 
 ** The following documented m4sugar macros are new:
    m4_argn  m4_default_nblank  m4_default_nblank_quoted  m4_ifblank
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 15798a4..a4bb429 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -8760,7 +8760,8 @@ the last one wins.
 Like @code{AC_DEFINE}, but three shell expansions are
 performed---once---on @var{variable} and @var{value}: variable expansion
 (@samp{$}), command substitution (@samp{`}), and backslash escaping
-(@samp{\}).  Single and double quote characters in the value have no
+(@samp{\}), as if in an unquoted here-document.  Single and double quote
+characters in the value have no
 special meaning.  Use this macro instead of @code{AC_DEFINE} when
 @var{variable} or @var{value} is a shell variable.  Examples:
 
@@ -12357,7 +12358,7 @@ A mess; trouble.  [Obs.] --Beau.@: & Fl.
 
 M4sh reserves the M4 macro namespace @samp{^_AS_} for internal use, and
 the namespace @samp{^AS_} for M4sh macros.  It also reserves the shell
-and environment variable namespace @samp{^as_}, and the here-doc
+and environment variable namespace @samp{^as_}, and the here-document
 delimiter namespace @samp{^_AS[A-Z]} in the output file.  You should not
 define your own macros or output shell code that conflicts with these
 namespaces.
@@ -12439,10 +12440,10 @@ The default for @var{chars} (@samp{\"$`}) is the set 
of characters
 needing escapes when @var{string} will be used literally within double
 quotes.  One common variant is the set of characters to protect when
 @var{string} will be used literally within back-ticks or an unquoted
-here-doc (@samp{\$`}).  Another common variant is @samp{""}, which can
+here-document (@samp{\$`}).  Another common variant is @samp{""}, which can
 be used to form a double-quoted string containing the same expansions
 that would have occurred if @var{string} were expanded in an unquoted
-here-doc; however, when using this variant, care must be taken that
+here-document; however, when using this variant, care must be taken that
 @var{string} does not use double quotes within complex variable
 expansions (such as @address@hidden "hi"address@hidden) that would be broken
 with improper escapes.
@@ -13051,7 +13052,7 @@ namespace @samp{^AC_} to prevent them from accidentally 
conflicting with
 other text; Autoconf also reserves the namespace @samp{^_AC_} for
 internal macros.  All shell variables that they use for internal
 purposes have mostly-lowercase names starting with @samp{ac_}.  Autoconf
-also uses here-doc delimiters in the namespace @samp{^_AC[A-Z]}.  During
+also uses here-document delimiters in the namespace @samp{^_AC[A-Z]}.  During
 @command{configure}, files produced by Autoconf make heavy use of the
 file system namespace @samp{^conf}.
 
@@ -22282,7 +22283,7 @@ namespace @samp{^AT_} to prevent them from accidentally 
conflicting with
 other text; Autoconf also reserves the namespace @samp{^_AT_} for
 internal macros.  All shell variables used in the testsuite for internal
 purposes have mostly-lowercase names starting with @samp{at_}.  Autotest
-also uses here-doc delimiters in the namespace @samp{^_AT[A-Z]}, and
+also uses here-document delimiters in the namespace @samp{^_AT[A-Z]}, and
 makes use of the file system namespace @samp{^at-}.
 
 Since Autoconf is built on top of M4sugar (@pxref{Programming in
@@ -22403,11 +22404,12 @@ be a single shell word that expands into a single 
file name.
 
 @defmac AT_CHECK (@var{commands}, @dvar{status, 0}, @ovar{stdout}, @
   @ovar{stderr}, @ovar{run-if-fail}, @ovar{run-if-pass})
address@hidden AT_CHECK_NOESCAPE (@var{commands}, @dvar{status, 0}, 
@ovar{stdout}, @
address@hidden AT_CHECK_UNQUOTED (@var{commands}, @dvar{status, 0}, 
@ovar{stdout}, @
   @ovar{stderr}, @ovar{run-if-fail}, @ovar{run-if-pass})
 @atindex{CHECK}
address@hidden
-Execute a test by performing given shell @var{commands}.  These commands
address@hidden
+Execute a test by performing given shell @var{commands}.  @var{commands}
+is output as-is, so shell expansions are honored.  These commands
 should normally exit with @var{status}, while producing expected
 @var{stdout} and @var{stderr} contents.  If @var{commands} exit with
 unexpected status 77, then the rest of the test group is skipped.  If
@@ -22433,9 +22435,13 @@ parameter is treated as text that must exactly match 
the output given by
 @var{commands} on standard out and standard error (including an empty
 parameter for no output); any differences are captured in the testsuite
 log and the test is failed.  The difference between @code{AT_CHECK} and
address@hidden is that only the latter performs shell
-expansions on comparison text given in the @var{stdout} and @var{stderr}
-arguments.
address@hidden is that only the latter performs shell variable
+expansion (@samp{$}), command substitution (@samp{`}), and backslash
+escaping (@samp{\}) on comparison text given in the @var{stdout} and
address@hidden arguments; if the text includes a trailing newline, this
+would be the same as if it were specified via an unquoted
+here-document.  (However, there is no difference in the interpretation
+of @var{commands}).
 
 @table @samp
 @item ignore
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 2e622a5..ce65397 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -332,7 +332,7 @@ at_fn_check_skip ()
 {
   case $[1] in
     99) echo 99 > "$at_status_file"; at_failed=:
-        AS_ECHO(["$[2]: hard failure"]); exit 99;;
+       AS_ECHO(["$[2]: hard failure"]); exit 99;;
     77) echo 77 > "$at_status_file"; exit 77;;
   esac
 }
@@ -350,7 +350,7 @@ dnl $? = 77 or $? = 99.
     $[1] ) ;;
     77) echo 77 > "$at_status_file"; exit 77;;
     99) echo 99 > "$at_status_file"; at_failed=:
-        AS_ECHO(["$[3]: hard failure"]); exit 99;;
+       AS_ECHO(["$[3]: hard failure"]); exit 99;;
     *) AS_ECHO(["$[3]: exit code was $[2], expected $[1]"])
       at_failed=:;;
   esac
@@ -1901,15 +1901,24 @@ $2[]_ATEOF
 # This may cause spurious failures when the test suite is run with `-x'.
 #
 _AT_DEFINE_SETUP([AT_CHECK],
-[_AT_CHECK(m4_expand([$1]), [$2], m4_expand([AS_ESCAPE([$3])]),
-  m4_expand([AS_ESCAPE([$4])]), [$5], [$6])])
+[_AT_CHECK(m4_expand([$1]), [$2], AS_ESCAPE(m4_dquote(m4_expand([$3]))),
+  AS_ESCAPE(m4_dquote(m4_expand([$4]))), [$5], [$6])])
 
-# AT_CHECK_NOESCAPE(COMMANDS, [STATUS = 0], STDOUT, STDERR,
+# AT_CHECK_UNQUOTED(COMMANDS, [STATUS = 0], STDOUT, STDERR,
 #                   [RUN-IF-FAIL], [RUN-IF-PASS])
 # ---------------------------------------------------------
 # Like AT_CHECK, but do not AS_ESCAPE shell metacharacters in the STDOUT
 # and STDERR arguments before running the comparison.
-_AT_DEFINE_SETUP([AT_CHECK_NOESCAPE],
+_AT_DEFINE_SETUP([AT_CHECK_UNQUOTED],
+[_AT_CHECK(m4_expand([$1]), [$2], AS_ESCAPE(m4_dquote(m4_expand([$3])), [""]),
+  AS_ESCAPE(m4_dquote(m4_expand([$4])), [""]), [$5], [$6])])
+
+# AT_CHECK_NOESCAPE(COMMANDS, [STATUS = 0], STDOUT, STDERR,
+#                   [RUN-IF-FAIL], [RUN-IF-PASS])
+# ---------------------------------------------------------
+# Obsolete spelling of AT_CHECK_UNQUOTED.
+m4_define([AT_CHECK_NOESCAPE],
+[m4_warn([obsolete], [consider using AT_CHECK_UNQUOTED instead of $0])]dnl
 [_AT_CHECK(m4_expand([$1]), [$2], m4_expand([$3]),
   m4_expand([$4]), [$5], [$6])])
 
diff --git a/tests/autotest.at b/tests/autotest.at
index 721925c..d86088c 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -287,6 +287,13 @@ AT_CHECK_AT_TEST([errexit],
    AT_CHECK([grep "1 .* inhibited subsequent" stderr], [], [ignore])],
   [--errexit])
 
+AT_CHECK_AT_TEST([unquoted output],
+  [m4_define([backtick], [`])
+   a=a
+   AT_CHECK_UNQUOTED([echo 'a"b  backtick`'], [],
+     [${a}"`echo 'b  '`\`\backtick]m4_newline)],
+  [], [], [], [], [AT_KEYWORDS([AT@&address@hidden)])
+
 AT_CHECK_AT([Logging],
   [[AT_INIT([artificial test suite])
     dnl intentionally write failing tests, to see what gets logged
@@ -349,7 +356,7 @@ AT_CHECK_AT([Binary output],
     str=$str$str$str$str$str$str$str$str$str$str
     str=$str$str$str$str$str$str$str$str$str$str
     str=$str$str$str$str$str
-    AT_CHECK_NOESCAPE([echo $str], [0], [[$str]m4_newline])
+    AT_CHECK_UNQUOTED([echo $str], [0], [[$str]m4_newline])
     AT_CLEANUP
     AT_SETUP([fail: no trailing newline])
     AT_CHECK([printf short], [0], [stdout-nolog])
@@ -366,7 +373,7 @@ AT_CHECK_AT([Binary output],
     str=$str$str$str$str$str$str$str$str$str$str
     str=$str$str$str$str$str$str$str$str$str$str
     str=$str$str$str$str$str
-    AT_CHECK_NOESCAPE([echo x$str], [0], [[${str}x]m4_newline])
+    AT_CHECK_UNQUOTED([echo x$str], [0], [[${str}x]m4_newline])
     AT_CLEANUP
 ]], [], [0], [], [], [],
   [AT_CHECK([$CONFIG_SHELL ./micro-suite 4], [1], [ignore], [ignore])
@@ -376,10 +383,10 @@ AT_CHECK_AT([Binary output],
 
 AT_CHECK_AT_TEST([Cleanup],
   [AT_CHECK([test ! -f cleanup.success && test ! -f cleanup.failure])
-   AT_CHECK_NOESCAPE([exit $value], [ignore], [$output],
+   AT_CHECK_UNQUOTED([exit $value], [ignore], [$output],
      [], [touch cleanup.failure], [touch cleanup.success])],
   [], [], [], [],
-  [AT_KEYWORDS([AT@&address@hidden)
+  [AT_KEYWORDS([AT@&address@hidden)
     output=; export output],
   [AT_CHECK([test -d micro-suite.dir/1])
    AT_CHECK([test -f micro-suite.dir/1/cleanup.success])
@@ -484,6 +491,12 @@ bar'])
 ]], [])])
 
 
+AT_CHECK_AT_TEST([Metacharacters in command from M4 expansion],
+  [m4_define([GNU], [\"`])
+   AT_CHECK([echo '\"`' [GNU] 'GNU'], 0, [GNU [G][NU] [\"`
+]], [])])
+
+
 ## -------------------------------------- ##
 ## Backslash-<newline> in test commands.  ##
 ## -------------------------------------- ##
diff --git a/tests/torture.at b/tests/torture.at
index 9d58e51..11cd05a 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -326,11 +326,11 @@ END
           [0], [ignore])
   # Run the same test a 2nd time to see that config.status does not recreate
   # the header (regression test)
-  AT_CHECK_NOESCAPE([./config.status "--header=$file:$file.in"],
+  AT_CHECK_UNQUOTED([./config.status "--header=$file:$file.in"],
                    [0], [config.status: creating $file
 config.status: $file is unchanged
 ])
-  AT_CHECK_NOESCAPE([grep ' & ' "$file"], [],
+  AT_CHECK_UNQUOTED([grep ' & ' "$file"], [],
 [/* $file.  Generated from $file.in by configure.  */
 ])
   AT_CHECK([$FGREP "$file" "$file"], [0], [ignore])


hooks/post-receive
-- 
GNU Autoconf source repository




reply via email to

[Prev in Thread] Current Thread [Next in Thread]