On 08/27/2010 03:43 PM, Ralf Wildenhues wrote:
* Eric Blake wrote on Fri, Aug 27, 2010 at 09:24:49PM CEST:
I wish you wouldn't use nor promote tmp as temporary variable name,
nor as a temporary macro name in tests/m4sh.at, given that it's already
documented as name of a temporary directory to use in config.status.

Good point.  I'm scrubbing that now...

Done.  I'll wait till Monday to push, though, in case you have further
comments.

Looks good to me, thanks!

Eric Blake (2):
   docs: avoid use of $tmp outside of config.status use
   config.status: minimize use of $tmp

As promised, here's the testsuite addition I'm adding to 2/2 before pushing. I verified that the testsuite addition without the status.m4 changes fails, but the patch as a whole succeeds.

diff --git c/tests/torture.at w/tests/torture.at
index 6855da4..e395fc1 100644
--- c/tests/torture.at
+++ w/tests/torture.at
@@ -29,6 +29,34 @@ AT_CHECK_MACRO([AC_CONFIG_COMMANDS with empty commands],
 ]])


+## --------------------------------------------- ##
+## AC_CONFIG_COMMANDS with temporary directory.  ##
+## --------------------------------------------- ##
+
+AT_CHECK_MACRO([AC_CONFIG_COMMANDS with temporary directory],
+[[AC_CONFIG_COMMANDS([foo], [
+case $ACTION in
+  use)
+    echo "$tmp" > tmpdir
+    test -d "$tmp" || AC_MSG_ERROR([No $tmp directory])
+    echo garbage-in > "$tmp/garbage-out"
+    ;;
+  corrupt)
+    echo "$tmp" > tmpdir
+    tmp=/nosuch
+    ;;
+  *) ;;
+esac
+])
+]], [
+AT_CHECK([test ! -f tmpdir])
+AT_CHECK([ACTION=use ./config.status], [], [ignore])
+AT_CHECK([test -s tmpdir && test ! -d "`cat tmpdir`"])
+AT_CHECK([ACTION=corrupt ./config.status], [], [ignore])
+AT_CHECK([test -s tmpdir && test ! -d "`cat tmpdir`"])
+])
+
+
 ## -------------------------- ##
 ## Multiple AC_CONFIG_FILES.  ##
 ## -------------------------- ##

--
Eric Blake   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to