bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH] init.sh: Consider OS/2-style path
@ 2023-10-02 15:56 KO Myung-Hun
  0 siblings, 0 replies; 4+ messages in thread
From: KO Myung-Hun @ 2023-10-02 15:56 UTC (permalink / raw)
  To: bug-gnulib

tests/init.sh (setup_): Use $PATH_SEPARATOR as a path separator, and
consider an OS/2-style absolute path.
---
 tests/init.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/init.sh b/tests/init.sh
index 0494097e9f..2a88865972 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -435,14 +435,14 @@ setup_ ()
   # Remove relative and non-accessible directories from PATH, including '.'
   # and Zero-length entries.
   saved_IFS="$IFS"
-  IFS=:
+  IFS="$PATH_SEPARATOR"
   new_PATH=
   sep_=
   for dir in $PATH; do
     case "$dir" in
-      /*) test -d "$dir/." || continue
+      /* | ?:*) test -d "$dir/." || continue
           new_PATH="${new_PATH}${sep_}${dir}"
-          sep_=':';;
+          sep_="$PATH_SEPARATOR";;
     esac
   done
   IFS="$saved_IFS"
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] init.sh: Consider OS/2-style path
@ 2024-01-15  6:37 KO Myung-Hun
  2024-01-15 15:10 ` Bruno Haible
  0 siblings, 1 reply; 4+ messages in thread
From: KO Myung-Hun @ 2024-01-15  6:37 UTC (permalink / raw)
  To: bug-gnulib

tests/init.sh (setup_): Use $PATH_SEPARATOR as a path separator, and
consider an OS/2-style absolute path.
---
 tests/init.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/init.sh b/tests/init.sh
index aef5eea808..8b5dc2b23e 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -435,14 +435,14 @@ setup_ ()
   # Remove relative and non-accessible directories from PATH, including '.'
   # and Zero-length entries.
   saved_IFS="$IFS"
-  IFS=:
+  IFS="$PATH_SEPARATOR"
   new_PATH=
   sep_=
   for dir in $PATH; do
     case "$dir" in
-      /*) test -d "$dir/." || continue
+      /* | ?:*) test -d "$dir/." || continue
           new_PATH="${new_PATH}${sep_}${dir}"
-          sep_=':';;
+          sep_="$PATH_SEPARATOR";;
     esac
   done
   IFS="$saved_IFS"
-- 
2.42.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] init.sh: Consider OS/2-style path
  2024-01-15  6:37 [PATCH] init.sh: Consider OS/2-style path KO Myung-Hun
@ 2024-01-15 15:10 ` Bruno Haible
  2024-01-16  3:03   ` KO Myung-Hun
  0 siblings, 1 reply; 4+ messages in thread
From: Bruno Haible @ 2024-01-15 15:10 UTC (permalink / raw)
  To: bug-gnulib; +Cc: KO Myung-Hun

[-- 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] init.sh: Consider OS/2-style path
  2024-01-15 15:10 ` Bruno Haible
@ 2024-01-16  3:03   ` KO Myung-Hun
  0 siblings, 0 replies; 4+ messages in thread
From: KO Myung-Hun @ 2024-01-16  3:03 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib



Bruno Haible wrote:
> 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.
> 
> 
> 

Thanks!


-- 
KO Myung-Hun

Korean OS/2 User Community : https://www.os2.kr/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-16  3:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-15  6:37 [PATCH] init.sh: Consider OS/2-style path KO Myung-Hun
2024-01-15 15:10 ` Bruno Haible
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

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).