]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
test: elide leading spaces within case for macOS sh.
authorKarl Berry <karl@freefriends.org>
Mon, 29 Jan 2024 22:16:01 +0000 (14:16 -0800)
committerKarl Berry <karl@freefriends.org>
Mon, 29 Jan 2024 22:16:01 +0000 (14:16 -0800)
Yet another fix in https://bugs.gnu.org/68119.

* t/py-compile-basedir.sh: sed away the leading spaces
from wc -l output within the case statement.

t/py-compile-basedir.sh

index 7ccb8e11c7895ee19373f195740836fce18ec5b7..b9bbb3913d28a376aea1f1eac38dcb8dfc6d2da7 100644 (file)
@@ -42,8 +42,13 @@ for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do
   py_installed "$d2/$f.pyc"
   py_installed "$d2/sub/$f.pyc"
   files=$(find "$d2" | grep '\.py[co]$')
-  # with new-enough Python3, there are six files.
-  case $(echo "$files" | wc -l) in 4|6) ;; *) false;; esac
+  #
+  # 1) With new-enough Python3, there are six files.
+  # 
+  # 2) We have to elide the leading spaces from the wc output
+  #    for the sake of the macOS shell.
+  #    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68119#4
+  case $(echo "$files" | wc -l | sed 's/^ *//') in 4|6) ;; *) false;; esac
   case $d2 in
     .|..) rm -f $files;;
        *) rm -rf "$d2";;