As reported by various people, most recently by Bruce Dugan, the autoconf testsuite has spurious failures on MacOS 10.5, where readdir intermittently lists a file more than once in the face of a rapidly changing directory. I'm applying this, under the assumption that 'sort -u' is portable (at any rate, it is already in use in mktests.sh, so the testsuite isn't even built properly if it is not portable). I didn't spend the time researching the list archives for the first instance of a similar report; if someone feels that would be important, we can commit a followup with additional attribution.
From: Eric Blake <[EMAIL PROTECTED]> Date: Tue, 2 Dec 2008 11:15:55 -0700 Subject: [PATCH] Avoid MacOS readdir bug in testsuite. * tests/local.at (AC_STATE_SAVE): Avoid spurious failures due to duplicated ls entries. * THANKS: Update. Reported by Bruce Dugan and others. Signed-off-by: Eric Blake <[EMAIL PROTECTED]> --- ChangeLog | 8 ++++++++ THANKS | 1 + tests/local.at | 4 +++- 3 files changed, 12 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2db458d..7ca53e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-12-02 Eric Blake <[EMAIL PROTECTED]> + + Avoid MacOS readdir bug in testsuite. + * tests/local.at (AC_STATE_SAVE): Avoid spurious failures due to + duplicated ls entries. + * THANKS: Update. + Reported by Bruce Dugan and others. + 2008-11-29 Ralf Wildenhues <[EMAIL PROTECTED]> * lib/autotest/general.m4 (AT_JOB_FIFO_FD): Hide zsh 4.3.4 diff --git a/THANKS b/THANKS index bd394e1..a3ae8c2 100644 --- a/THANKS +++ b/THANKS diff --git a/tests/local.at b/tests/local.at index 041d103..2ec7bc5 100644 --- a/tests/local.at +++ b/tests/local.at @@ -197,9 +197,11 @@ m4_define([AT_CONFIGURE_AC], # confirm that no test modifies variables outside the Autoconf namespace or # leaves temporary files. AT_CONFIG_CMP uses the variable dumps to confirm that # tests have the same side effects regardless of caching. +# The sort -u is necessary, since MacOS 10.5 has a bug where readdir can +# list a file multiple times in a rapidly changing directory. m4_defun([AC_STATE_SAVE], [(set) 2>&1 | sort >state-env.$][1 -ls -1 | sed '/^at-/d;/^state-/d;/^config\./d' | sort >state-ls.$][1 +ls -1 | sed '/^at-/d;/^state-/d;/^config\./d' | sort -u >state-ls.$][1 ])# AC_STATE_SAVE ]]) -- 1.6.0.4