tests: avoid several spurious failures on Solaris
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 24 Jun 2012 15:57:10 +0000 (17:57 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 24 Jun 2012 15:58:52 +0000 (17:58 +0200)
* t/ax/is_newest: Rewrite to be Bourne-compatible, for /bin/sh shells like
Solaris' that are not POSIX-conforming.  The script is so small that such
a rewrite is easier than going through the hoops that would be required to
ensure this script is always executed with a POSIX shell.
* t/ax/is: Add a comment stating that this script is to be kept Bourne
compatible as well.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/ax/is
t/ax/is_newest

diff --git a/t/ax/is b/t/ax/is
index 1e1c0ce..4f043ca 100755 (executable)
--- a/t/ax/is
+++ b/t/ax/is
@@ -21,6 +21,9 @@
 # in the face of variables defined through line-continuations,
 # automake rewrites and expansions of empty variables.
 
+# NOTE: keep this file Bourne-compatible, for the sake of systems with
+#       non-POSIX /bin/sh (like Solaris).
+
 set -e
 set -u
 
index f52a1a8..cd1a38e 100755 (executable)
 
 # Usage: is_newest FILE FILES
 # Fail if any file in FILES is newer than FILE, and print the list of
-# such files on the standard error.
-# Resolve ties in favor of FILE.
+# such files on the standard error.  Resolve ties in favor of FILE.
+
+# NOTE: keep this file Bourne-compatible, for the sake of systems with
+#       non-POSIX /bin/sh (like Solaris).
 
 set -u
 
@@ -29,7 +31,7 @@ if test $# -lt 2; then
 fi
 
 file=$1; shift
-newer_files=$(find "$@" -prune -newer "$file") || exit $?
+newer_files=`find "$@" -prune -newer "$file"` || exit $?
 
 if test -n "$newer_files"; then
   echo "$me: these files are newer than '$file':" >&2