From: Karl Berry Date: Mon, 29 Jan 2024 22:16:01 +0000 (-0800) Subject: test: elide leading spaces within case for macOS sh. X-Git-Tag: v1.16.90~15 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c354194e691fac341c7416be29eca2b25a0a0e4a;p=thirdparty%2Fautomake.git test: elide leading spaces within case for macOS sh. 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. --- diff --git a/t/py-compile-basedir.sh b/t/py-compile-basedir.sh index 7ccb8e11c..b9bbb3913 100644 --- a/t/py-compile-basedir.sh +++ b/t/py-compile-basedir.sh @@ -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";;