]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: workaround for shells with broken 'set -e'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 12 Feb 2012 17:03:08 +0000 (18:03 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 12 Feb 2012 17:03:29 +0000 (18:03 +0100)
* tests/dist-formats.tap: Some versions of the BSD shell wrongly
bail out when the 'errexit' shell flag is active and the left-hand
command in a "&&" list fails and that list is the *last* command
of a "case" statement.  This was causing an incorrect initialization
of the '$missing_compressors' variable, and thus potential spurious
failures when non-existing programs were assumed to be available.

tests/dist-formats.tap

index 80be9c9e53790cd1440d138429d5f78e93c7a651..612af54a4ce9e3dd7485aa9625d262243f3eea4b 100755 (executable)
@@ -80,7 +80,8 @@ missing_compressors=`
     case $c in
       # Assume gzip(1) is available on every reasonable portability target.
       gzip)
-        continue;;
+        continue
+        ;;
       # On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
       # and is just a dummy script that is not able to actually compress
       # (it can only decompress).  So, check that the 'compress' program
@@ -92,9 +93,13 @@ missing_compressors=`
       compress)
         for x in 1 2 3 4 5 6 7 8; do
           echo aaaaaaaaaaaaaaa
-        done | $c -c >/dev/null && continue;;
+        done | $c -c >/dev/null && continue
+        : For shells with busted 'set -e'.
+        ;;
       *)
-        $c --version </dev/null >&2 && continue;;
+        $c --version </dev/null >&2 && continue
+        : For shells with busted 'set -e'.
+        ;;
     esac
     echo $c
   done | tr "$nl" ' '`