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.63-69-g


From: Paolo Bonzini
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.63-69-g5969d90
Date: Sat, 18 Oct 2008 22:09:21 +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=5969d900088b6f1e5f379d83191765b0636c51a1

The branch, master has been updated
       via  5969d900088b6f1e5f379d83191765b0636c51a1 (commit)
      from  af61badc821bcef780650da9032adbc4d86d1db5 (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 5969d900088b6f1e5f379d83191765b0636c51a1
Author: Paolo Bonzini <address@hidden>
Date:   Sat Oct 18 15:08:17 2008 +0200

    Make sure that nested AS_REQUIRE do not lose the desired diversion.
    
    * lib/m4sugar/m4sh.m4 (AS_REQUIRE): Expand _m4_divert_desired before
    passing it to m4_divert_require, so that its content is not used
    anymore.
    * tests/m4sh.at (Nested AS_REQUIRE): New testcase.

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

Summary of changes:
 ChangeLog           |    8 ++++++++
 lib/m4sugar/m4sh.m4 |    5 ++++-
 tests/m4sh.at       |   38 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 25c8826..5380a50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-10-18  Paolo Bonzini  <address@hidden>
+
+       Make sure that nested AS_REQUIRE do not lose the desired diversion.
+       * lib/m4sugar/m4sh.m4 (AS_REQUIRE): Expand _m4_divert_desired before
+       passing it to m4_divert_require, so that its content is not used
+       anymore.
+       * tests/m4sh.at (Nested AS_REQUIRE): New testcase.
+
 2008-10-18  Eric Blake  <address@hidden>
 
        Document bugs in { } handling.
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 75b8d84..fbce026 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -314,11 +314,14 @@ m4_divert_pop[]dnl
 # given diversion when expanded (required or not).  The expansion
 # goes in the named diversion or an earlier one.
 #
+# Note: we expand _m4_divert_desired before passing it to m4_divert_require,
+# otherwise we would need to use m4_pushdef and m4_popdef instead of
+# simply m4_define.
 m4_defun([AS_REQUIRE],
 [m4_define([_m4_divert_desired], [m4_default_quoted([$3], [M4SH-INIT])])dnl
 m4_if(m4_eval(_m4_divert(_m4_divert_dump) <= _m4_divert(_m4_divert_desired)), 
1,
       [m4_require([$1], [$2])],
-      [m4_divert_require([_m4_divert_desired], [$1], [$2])])])
+      [m4_divert_require(_m4_divert(_m4_divert_desired), [$1], [$2])])])
 
 
 # AS_REQUIRE_SHELL_FN(NAME-TO-CHECK, COMMENT, BODY-TO-EXPAND,
diff --git a/tests/m4sh.at b/tests/m4sh.at
index c39c8c1..75da8a4 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -536,6 +536,44 @@ AT_CHECK([./script])
 AT_CLEANUP
 
 
+## ------------------- ##
+## Nested AS_REQUIRE.  ##
+## ------------------- ##
+
+# Hypothesis: M4sh expands the requirements of AS_REQUIRE in the
+# requested diversion, even if other AS_REQUIREs are interleaved.
+
+AT_SETUP([Nested AS@&address@hidden)
+AT_KEYWORDS([m4sh])
+
+AT_DATA_M4SH([script.as], [[dnl
+AS_INIT
+
+m4_defun([in_fn_diversion], still_in_m4sh_init_fn=yes)
+m4_defun([not_in_fn_diversion], still_in_m4sh_init_fn=no)
+
+m4_defun([NESTED], [nested_require_in_fn_diversion=$still_in_m4sh_init_fn])
+
+m4_defun([OUTER], [AS_REQUIRE([NESTED])dnl
+outer_require_in_fn_diversion=$still_in_m4sh_init_fn])
+
+m4_defun([test_init], [
+AS_REQUIRE([in_fn_diversion], , [M4SH-INIT-FN])
+AS_REQUIRE([OUTER], , [M4SH-INIT-FN])
+AS_REQUIRE([not_in_fn_diversion], , [M4SH-INIT-FN])
+])
+
+test_init
+if test $outer_require_in_fn_diversion != yes; then AS_EXIT([1]); fi
+if test $nested_require_in_fn_diversion != no; then AS_EXIT([1]); fi
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([./script])
+
+AT_CLEANUP
+
+
 ## ------------------------------------ ##
 ## AS_REQUIRE_SHELL_FN and m4_require.  ##
 ## ------------------------------------ ##


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

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