From c354194e691fac341c7416be29eca2b25a0a0e4a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 29 Jan 2024 14:16:01 -0800 Subject: [PATCH] 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. --- t/py-compile-basedir.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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";; -- 2.47.2