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-9-g


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.63b-9-gef8940d
Date: Fri, 10 Apr 2009 12:30:28 +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=ef8940d9b5a3fe2866027f82a535915da3e78829

The branch, master has been updated
       via  ef8940d9b5a3fe2866027f82a535915da3e78829 (commit)
      from  1c34e5113f6b28370cec6a5d8ffe605bd67d4fde (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 ef8940d9b5a3fe2866027f82a535915da3e78829
Author: Eric Blake <address@hidden>
Date:   Fri Apr 10 06:26:33 2009 -0600

    Add undocumented _AS_CLEAN_DIR.
    
    * lib/m4sugar/m4sh.m4 (_AS_CLEAN_DIR): New macro; fixes m4 quoting
    in previous patch.
    * lib/autotest/general.m4 (AT_INIT) <at_fn_group_prepare>: Use new
    macro.
    * tests/m4sh.at (_AS@&address@hidden): New test.
    Reported by Ralf Wildenhues.
    
    Signed-off-by: Eric Blake <address@hidden>

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

Summary of changes:
 ChangeLog               |   10 ++++++++++
 lib/autotest/general.m4 |    5 +----
 lib/m4sugar/m4sh.m4     |   11 +++++++++++
 tests/m4sh.at           |   29 +++++++++++++++++++++++++++++
 4 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index be9ab98..7ee10f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-04-10  Eric Blake  <address@hidden>
+
+       Add undocumented _AS_CLEAN_DIR.
+       * lib/m4sugar/m4sh.m4 (_AS_CLEAN_DIR): New macro; fixes m4 quoting
+       in previous patch.
+       * lib/autotest/general.m4 (AT_INIT) <at_fn_group_prepare>: Use new
+       macro.
+       * tests/m4sh.at (_AS@&address@hidden): New test.
+       Reported by Ralf Wildenhues.
+
 2009-04-09  Eric Blake  <address@hidden>
 
        Avoid problems caused by deleting in-use directory.
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 9c6538e..906e481 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -1099,11 +1099,8 @@ at_fn_group_prepare ()
   # under the shell's notion of the current directory.
   at_group_dir=$at_suite_dir/$at_group_normalized
   at_group_log=$at_group_dir/$as_me.log
-  if test -d "$at_group_dir"; then
-    find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
-    rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??* ||
+  _AS_CLEAN_DIR("$at_group_dir") ||
     AS_WARN([test directory for $at_group_normalized could not be cleaned.])
-  fi
   # Be tolerant if the above `rm' was not able to remove the directory.
   AS_MKDIR_P(["$at_group_dir"])
 
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 88881b1..2b32802 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -1409,6 +1409,17 @@ m4_define([_AS_BOX_INDIR],
 _ASBOX])
 
 
+# _AS_CLEAN_DIR(DIR)
+# ------------------
+# Remove all contents from within DIR, including any unwritable
+# subdirectories, but leave DIR itself untouched.
+m4_define([_AS_CLEAN_DIR],
+[if test -d $1; then
+  find $1 -type d ! -perm -700 -exec chmod u+rwx {} \;
+  rm -fr $1/* $1/.[[!.]] $1/.??*
+fi])
+
+
 # AS_FUNCTION_DESCRIBE(NAME, [ARGS], DESCRIPTION, [WRAP-COLUMN = 79])
 # -------------------------------------------------------------------
 # Output a shell comment describing NAME and its arguments ARGS, then
diff --git a/tests/m4sh.at b/tests/m4sh.at
index def63aa..d747bfe 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -1371,3 +1371,32 @@ AT_CHECK([cat log], [0],
 ]])
 
 AT_CLEANUP
+
+
+## --------------- ##
+## _AS_CLEAN_DIR.  ##
+## --------------- ##
+
+AT_SETUP([_AS@&address@hidden)
+
+dnl ensure that we can erase all files in a directory.  Note that
+dnl _AS_CLEAN_DIR needs three globs to catch all these files.
+AT_DATA_M4SH([script.as], [[dnl
+AS_INIT
+# Unwritable subdirectories are common during 'make distcheck'.
+mkdir sub sub/unwritable || AS_ERROR([failed to mkdir])
+touch sub/unwritable/file || AS_ERROR([failed to touch])
+chmod a-wx sub/unwritable || AS_ERROR([failed to chmod])
+# Cygwin 1.5 can't touch 'sub/...', so make that file optional.
+touch sub/a sub/aa sub/aaa sub/.a sub/..a sub/.aa \
+  || AS_ERROR([failed to touch])
+touch sub/... 2>/dev/null
+_AS_CLEAN_DIR([sub]) || AS_ERROR([failed to clean])
+# rmdir instead of 'rm -fr' here proves that we emptied sub.
+rmdir sub || AS_ERROR([failed to rmdir])
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([./script])
+
+AT_CLEANUP


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

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