Skip to contentSkip to conversation

OpenSolaris/OpenIllumos: use /bin/bash if available for test scripts.

PATCH In review Gert Doering 3 participants 4 messages Oct 9, 2019 – Oct 10, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OpenSolaris/OpenIllumos: use /bin/bash if available for test scripts.

t_client.sh relies on "echo -e" and "echo -n" to produce nicely looking output, which fails on Solaris /bin/sh - force SHELL=/bin/bash on recent-enough Solaris variants that have it.

---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)
configure.ac +1 -0
index c7fd7a84..4159e450 100644
@@ -306,6 +306,7 @@ case "$host" in
 		AC_DEFINE([TARGET_SOLARIS], [1], [Are we running on Solaris?])
 		AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["S"], [Target prefix])
 		CPPFLAGS="$CPPFLAGS -D_XPG4_2"
+		test -x /bin/bash && SHELL="/bin/bash"
 		;;
 	*-*-openbsd*)
 		AC_DEFINE([TARGET_OPENBSD], [1], [Are we running on OpenBSD?])
Signature · 1 line
2.23.0
#1 lore raw
Quoted 4 lines

t_client.sh relies on "echo -e" and "echo -n" to produce nicely looking output, which fails on Solaris /bin/sh - force SHELL=/bin/bash on recent-enough Solaris variants that have it.

Where recent is "Solaris 8 or later"

I.e., just under 20 years old. :-)

Can't tell how which version of bash it was shipped with, though...

Casper

Acked-by on v1 1/1
#2 lore raw
In reply to Gert Doering
Quoted 15 lines · Gert Doering

t_client.sh relies on "echo -e" and "echo -n" to produce nicely looking output, which fails on Solaris /bin/sh - force SHELL=/bin/bash on recent-enough Solaris variants that have it.

---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)
configure.ac +0 -0
index c7fd7a84..4159e450 100644

configure.ac case "$host" in · line 312

Quoted 7 lines
configure.ac +1 -0
@@ -306,6 +306,7 @@ case "$host" in
 		AC_DEFINE([TARGET_SOLARIS], [1], [Are we running on Solaris?])
 		AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["S"], [Target prefix])
 		CPPFLAGS="$CPPFLAGS -D_XPG4_2"
+		test -x /bin/bash && SHELL="/bin/bash"
 		;;
 	*-*-openbsd*)
 		AC_DEFINE([TARGET_OPENBSD], [1], [Are we running on OpenBSD?])

I have not tested this (don't have access to Solaris environments), but looks like a reasonable solution.

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc
#3 lore raw
In reply to Gert Doering

Patch has been applied to the master branch.

commit 9c490c26a756dd0f4c08e003a4a94797983e1131

Author: Gert Doering
Date:   Wed Oct 9 14:00:43 2019 +0200
     OpenSolaris/OpenIllumos: use /bin/bash if available for test scripts.

     Signed-off-by: Gert Doering <[email protected]...>
     Acked-by: David Sommerseth <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg18914.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering