On 08/27/2010 01:24 PM, Eric Blake wrote:
I like the fact that I can use ${ac_tmp:=$tmp} ;)
$debug ||
{
- tmp=
+ tmp= ac_tmp=
trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; }&& exit $exit_status
+ { test ! -d "${ac_tmp:=$tmp}" || rm -fr "$ac_tmp"; }&& exit $exit_status
And then I promptly used it incorrectly. Per what we just documented,
we cannot assume that ${a=b} takes effect in the parent shell if we are
executing a child command like test, so the rm -fr "$ac_tmp" command
would be suspect in some, but not all, shells (although I don't know
that I could reliably reproduce the race conditions necessary to expose
that bug). So I'm squashing this in, by inspection:
diff --git i/lib/autoconf/status.m4 w/lib/autoconf/status.m4
index c44aed4..07889ae 100644
--- i/lib/autoconf/status.m4
+++ w/lib/autoconf/status.m4
@@ -1626,13 +1626,14 @@ fi
# Note that there is a small window in which the directory will not be
cleaned:
# after its creation but before its name has been assigned to `$tmp'.
dnl For historical reasons, AS_TMPDIR must continue to place the results
-dnl in $tmp; but we swap to the namespace clean $ac_tmp to avoid issues
+dnl in $tmp; but we swap to the namespace-clean $ac_tmp to avoid issues
dnl with any CONFIG_COMMANDS playing with the common variable name $tmp.
$debug ||
{
tmp= ac_tmp=
trap 'exit_status=$?
- { test ! -d "${ac_tmp:=$tmp}" || rm -fr "$ac_tmp"; } && exit $exit_status
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'AS_EXIT([1])' 1 2 13 15
}
--
Eric Blake [email protected] +1-801-349-2682
Libvirt virtualization library http://libvirt.org