autoconf-patches
[Top][All Lists]
Advanced

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

autotest fails when pwd is testgroup directory


From: Eric Blake
Subject: autotest fails when pwd is testgroup directory
Date: Fri, 31 Mar 2006 18:34:53 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

On cygwin, the current working directory of any process is locked from
removal (rmdir fails with EBUSY, as permitted by POSIX).  I encountered
a failed autotest run in tar, and went to investigate it as follows:

$ make check
... # Error - several tests, including 02, failed
$ cd tests/testsuite.dir/02
$ ./run
## --------------------------- ##
## GNU tar 1.15.90 test suite. ##
## --------------------------- ##
rm: cannot remove directory `/home/eblake/text/tar-
1.15.90/tests/testsuite.dir/02': Device or resource busy
mkdir: cannot create directory `/home/eblake/text/tar-
1.15.90/tests/testsuite.dir/02': File exists
testsuite: error: cannot create /home/eblake/text/tar-
1.15.90/tests/testsuite.dir/02
$

Ouch.  Because my shell is still in testsuite.dir/02, that directory is
locked from removal.  The ./run script is a thin wrapper around testsuite,
and testsuite attempted "rm -fr testsuite.dir/02", successfully removing
all its contents but failing to remove the directory itself, then fails to
remake the testgroup directory because it already exists, aborting
the test run and obliterating all information about the previous failed
run in the process.

The following patch still prints the warning about rm's inability to remove
the locked directory, but at least allows the testsuite to rerun the
test rather than giving up.  (Also, lib/autotest/general.m4 has some
spaces followed by tabs in code indentation that my editor wanted to clean
up; omitted from this patch but still useful to do).

2006-03-31  Eric Blake  <address@hidden>

        * lib/m4sugar/m4sh.m4 (AS_MKDIR_P): Allow use in shell lists.
        * lib/autotest/general.m4: Be tolerant of existing directory when
        rm failed to remove it.

Index: lib/autotest/general.m4
===================================================================
RCS file: /sources/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.199
diff -u -b -r1.199 general.m4
--- lib/autotest/general.m4     27 Mar 2006 17:42:18 -0000      1.199
+++ lib/autotest/general.m4     31 Mar 2006 16:28:16 -0000
@@ -699,7 +699,7 @@
        find $at_group_dir -type d ! -perm -700 -exec chmod u+rwx \{\} \;
        rm -fr $at_group_dir
       fi
-      mkdir $at_group_dir ||
+      AS_MKDIR_P([$at_group_dir]) ||
        AS_ERROR([cannot create $at_group_dir])
       cd $at_group_dir
       ;;
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /sources/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.165
diff -u -b -r1.165 m4sh.m4
--- lib/m4sugar/m4sh.m4 27 Mar 2006 17:42:18 -0000      1.165
+++ lib/m4sugar/m4sh.m4 31 Mar 2006 16:53:04 -0000
@@ -939,7 +939,7 @@
       as_dir=`AS_DIRNAME("$as_dir")`
     done
     test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || AS_ERROR([cannot create directory $1]); }
+  fi || AS_ERROR([cannot create directory $1]); }dnl
 ])# AS_MKDIR_P
 
 






reply via email to

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