[Openvpn-devel] OpenSolaris/OpenIllumos: use /bin/bash if available for test scripts.

Message ID 20191009120043.22692-1-gert@greenie.muc.de
State Accepted
Headers show
Series [Openvpn-devel] OpenSolaris/OpenIllumos: use /bin/bash if available for test scripts. | expand

Commit Message

Gert Doering Oct. 9, 2019, 1 a.m. UTC
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.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

Comments

Casper.Dik@oracle.com Oct. 9, 2019, 1:11 a.m. UTC | #1
>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
David Sommerseth Oct. 10, 2019, 7:21 a.m. UTC | #2
On 09/10/2019 14:00, Gert Doering wrote:
> 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.
> 
> Signed-off-by: Gert Doering <gert@greenie.muc.de>
> ---
>  configure.ac | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configure.ac b/configure.ac
> index c7fd7a84..4159e450 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -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.

Acked-By: David Sommerseth <davids@openpvn.net>
Gert Doering Oct. 10, 2019, 7:26 a.m. UTC | #3
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 <gert@greenie.muc.de>
     Acked-by: David Sommerseth <davids@openvpn.net>
     Message-Id: <20191009120043.22692-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18914.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/configure.ac b/configure.ac
index c7fd7a84..4159e450 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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?])