bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Cc: KO Myung-Hun <komh78@gmail.com>
Subject: Re: [PATCH] init.sh: Consider OS/2-style path
Date: Mon, 15 Jan 2024 16:10:48 +0100	[thread overview]
Message-ID: <3834565.FjKLVJYuhi@nimes> (raw)
In-Reply-To: <20240115063730.147-1-komh@chollian.net>

[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]

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  <bruno@clisp.org>

	test-framework-sh: Improve portability to native Windows and OS/2.
	Reported by KO Myung-Hun <komh78@gmail.com> 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 <komh78@gmail.com> 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 <komh78@gmail.com> 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.


[-- Attachment #2: 0001-test-framework-sh-Improve-portability-to-native-Wind.patch --]
[-- Type: text/x-patch, Size: 1635 bytes --]

From 13152ccfd0db839d0f02afce74074a35e1927276 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
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 <komh78@gmail.com> 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  <bruno@clisp.org>
+
+	test-framework-sh: Improve portability to native Windows and OS/2.
+	Reported by KO Myung-Hun <komh78@gmail.com> 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  <bruno@clisp.org>
 
 	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


[-- Attachment #3: 0002-test-framework-sh-Improve-portability-to-native-Wind.patch --]
[-- Type: text/x-patch, Size: 1767 bytes --]

From bf2fb4a4f41542a39074ea826cccca44bc67f854 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
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 <komh78@gmail.com> 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  <bruno@clisp.org>
 
+	test-framework-sh: Improve portability to native Windows and OS/2.
+	Reported by KO Myung-Hun <komh78@gmail.com> 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 <komh78@gmail.com> 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


[-- Attachment #4: 0003-test-framework-sh-Improve-portability-to-native-Wind.patch --]
[-- Type: text/x-patch, Size: 1555 bytes --]

From bdab4825519f56ccb518c73919245e12bb9d334e Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
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 <komh78@gmail.com> 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  <bruno@clisp.org>
 
+	test-framework-sh: Improve portability to native Windows and OS/2.
+	Reported by KO Myung-Hun <komh78@gmail.com> 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 <komh78@gmail.com> 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	other threads:[~2024-01-15 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15  6:37 [PATCH] init.sh: Consider OS/2-style path KO Myung-Hun
2024-01-15 15:10 ` Bruno Haible [this message]
2024-01-16  3:03   ` KO Myung-Hun
  -- strict thread matches above, loose matches on Subject: below --
2023-10-02 15:56 KO Myung-Hun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3834565.FjKLVJYuhi@nimes \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=komh78@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).