Hi KO,

Thanks for the reminder re 2023-10-02. A couple of details looked odd,
that's why I didn't find time to reply initially.

I've now updated this loop in the same style as GNU Autoconf does.


2024-01-15  Bruno Haible  <[email protected]>

        test-framework-sh: Improve portability to native Windows and OS/2.
        Reported by KO Myung-Hun <[email protected]> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.
        * tests/init.sh (setup_): Test for an absolute directory name like
        Autoconf does.

        test-framework-sh: Improve portability to native Windows and OS/2.
        Reported by KO Myung-Hun <[email protected]> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.
        * tests/init.sh (setup_): In new_PATH, use $PATH_SEPARATOR instead of
        ':'.

        test-framework-sh: Improve portability to native Windows and OS/2.
        Reported by KO Myung-Hun <[email protected]> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.
        * tests/init.sh (setup_): Set IFS, like in Autoconf's _AS_PATH_WALK and
        in build-aux/relocatable.sh.in.

>From 13152ccfd0db839d0f02afce74074a35e1927276 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Mon, 15 Jan 2024 15:50:52 +0100
Subject: [PATCH 1/3] test-framework-sh: Improve portability to native Windows
 and OS/2.

Reported by KO Myung-Hun <[email protected]> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.

* tests/init.sh (setup_): Set IFS, like in Autoconf's _AS_PATH_WALK and
in build-aux/relocatable.sh.in.
---
 ChangeLog     | 8 ++++++++
 tests/init.sh | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bc6a28c09f..e0788e2d74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-01-15  Bruno Haible  <[email protected]>
+
+	test-framework-sh: Improve portability to native Windows and OS/2.
+	Reported by KO Myung-Hun <[email protected]> in
+	<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.
+	* tests/init.sh (setup_): Set IFS, like in Autoconf's _AS_PATH_WALK and
+	in build-aux/relocatable.sh.in.
+
 2024-01-12  Bruno Haible  <[email protected]>
 
 	jit/cache tests: Fix link error.
diff --git a/tests/init.sh b/tests/init.sh
index aef5eea808..7d7b186451 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -434,11 +434,11 @@ setup_ ()
 
   # Remove relative and non-accessible directories from PATH, including '.'
   # and Zero-length entries.
-  saved_IFS="$IFS"
-  IFS=:
+  saved_IFS="$IFS"; IFS="$PATH_SEPARATOR"
   new_PATH=
   sep_=
   for dir in $PATH; do
+    IFS="$save_IFS"
     case "$dir" in
       /*) test -d "$dir/." || continue
           new_PATH="${new_PATH}${sep_}${dir}"
-- 
2.34.1

>From bf2fb4a4f41542a39074ea826cccca44bc67f854 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Mon, 15 Jan 2024 15:56:40 +0100
Subject: [PATCH 2/3] test-framework-sh: Improve portability to native Windows
 and OS/2.

Reported by KO Myung-Hun <[email protected]> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.

* tests/init.sh (setup_): In new_PATH, use $PATH_SEPARATOR instead of
':'.
---
 ChangeLog     | 6 ++++++
 tests/init.sh | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e0788e2d74..c43af9729d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-01-15  Bruno Haible  <[email protected]>
 
+	test-framework-sh: Improve portability to native Windows and OS/2.
+	Reported by KO Myung-Hun <[email protected]> in
+	<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.
+	* tests/init.sh (setup_): In new_PATH, use $PATH_SEPARATOR instead of
+	':'.
+
 	test-framework-sh: Improve portability to native Windows and OS/2.
 	Reported by KO Myung-Hun <[email protected]> in
 	<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.
diff --git a/tests/init.sh b/tests/init.sh
index 7d7b186451..98c97a9028 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -436,13 +436,13 @@ setup_ ()
   # and Zero-length entries.
   saved_IFS="$IFS"; IFS="$PATH_SEPARATOR"
   new_PATH=
-  sep_=
   for dir in $PATH; do
     IFS="$save_IFS"
     case "$dir" in
-      /*) test -d "$dir/." || continue
-          new_PATH="${new_PATH}${sep_}${dir}"
-          sep_=':';;
+      /*)
+        test -d "$dir/." || continue
+        new_PATH="${new_PATH}${new_PATH:+$PATH_SEPARATOR}${dir}"
+        ;;
     esac
   done
   IFS="$saved_IFS"
-- 
2.34.1

>From bdab4825519f56ccb518c73919245e12bb9d334e Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Mon, 15 Jan 2024 16:05:00 +0100
Subject: [PATCH 3/3] test-framework-sh: Improve portability to native Windows
 and OS/2.

Reported by KO Myung-Hun <[email protected]> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.

* tests/init.sh (setup_): Test for an absolute directory name like
Autoconf does.
---
 ChangeLog     | 6 ++++++
 tests/init.sh | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index c43af9729d..564a5c9a83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-01-15  Bruno Haible  <[email protected]>
 
+	test-framework-sh: Improve portability to native Windows and OS/2.
+	Reported by KO Myung-Hun <[email protected]> in
+	<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.
+	* tests/init.sh (setup_): Test for an absolute directory name like
+	Autoconf does.
+
 	test-framework-sh: Improve portability to native Windows and OS/2.
 	Reported by KO Myung-Hun <[email protected]> in
 	<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.
diff --git a/tests/init.sh b/tests/init.sh
index 98c97a9028..05b35cad98 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -439,7 +439,7 @@ setup_ ()
   for dir in $PATH; do
     IFS="$save_IFS"
     case "$dir" in
-      /*)
+      [\\/]* | ?:[\\/]*)
         test -d "$dir/." || continue
         new_PATH="${new_PATH}${new_PATH:+$PATH_SEPARATOR}${dir}"
         ;;
-- 
2.34.1

Reply via email to