This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rebase PATCH] Introduce --with-posix-shell configure flag.


On 4/10/19 2:32 PM, Michael Haubenwallner wrote:
> On 4/10/19 11:02 AM, Corinna Vinschen wrote:
>> On Apr  9 11:23, Michael Haubenwallner wrote:
>>> Some distros prefer a POSIX shell other than /bin/ash and /bin/dash.
>>
>> I think this is pretty old stuff nobody really looked at for a while.
>> ash and dash are the same binary anyway, both are dash.
> 
> Patch updated.

and attached now.

> 
>>
>> I'd prefer to drop the distinction between ash and dash, so dash
>> is default and --with-dash becomes a no-op.
>>
>> Also, why not just SHELL?
> 
> The variable SHELL does have meanings to the system() call,
> and may not necessarily denote a POSIX compatible shell.
> 
> Thanks!
> /haubi/
> 

>From 052be19f0ff522a8b8fc57df933f4b5e39602ea0 Mon Sep 17 00:00:00 2001
From: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
Date: Fri, 5 Apr 2019 15:37:04 +0200
Subject: [PATCH] Introduce --with-posix-shell configure flag.

Some distros prefer a POSIX shell other than /bin/dash, which is the
default.  Remove --with-dash configure flag, is POSIX shell default.
---
 Makefile.in   |  4 ++--
 configure.ac  | 18 +++++++++++++-----
 peflagsall.in |  2 +-
 rebaseall.in  |  2 +-
 4 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index e984070..34c4684 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -53,7 +53,7 @@ LN_S = @LN_S@
 SED = @SED@
 EGREP = @EGREP@
 FGREP = @FGREP@
-ASH = @ASH@
+POSIXSHELL = @POSIXSHELL@
 
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(srcdir)/imagehelper
 DEFS = @DEFS@ -DVERSION='"$(PACKAGE_VERSION)"' -DLIB_VERSION='"$(LIB_VERSION)"' -DSYSCONFDIR='"$(sysconfdir)"'
@@ -128,7 +128,7 @@ edit = sed \
 	-e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
 	-e 's|@prefix[@]|$(prefix)|g' \
 	-e 's|@exec_prefix[@]|$(exec_prefix)|g' \
-	-e 's|@ASH[@]|$(ASH)|g' \
+	-e 's|@POSIXSHELL[@]|$(POSIXSHELL)|g' \
 	-e 's|@DEFAULT_OFFSET_VALUE[@]|$(DEFAULT_OFFSET_VALUE)|g'
 
 rebaseall peflagsall: Makefile
diff --git a/configure.ac b/configure.ac
index 1dc9bf4..d539dbf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,11 +8,19 @@ AC_CONFIG_SRCDIR([peflags.c])
 AC_PREFIX_DEFAULT([/usr])
 AC_CANONICAL_HOST
 
-AC_ARG_WITH([dash], AS_HELP_STRING([use dash instead of ash]),
-            [], [with_dash=no])
-ASH=ash
-AS_IF([test "x$with_dash" != xno], [ASH=dash])
-AC_SUBST([ASH])
+AC_MSG_CHECKING([for POSIX shell to use in scripts])
+AC_ARG_WITH([posix-shell],
+			AS_HELP_STRING([--with-posix-shell=/bin/dash],
+						   [POSIX shell to use for scripts, default=/bin/dash]),
+			[AS_CASE([$with_posix_shell],
+					 [yes|no|''],
+					 [AC_MSG_ERROR([Need shell path for --with-posix-shell, got '$with_posix_shell'.])],
+					 [/*],
+					 [POSIXSHELL=$with_posix_shell],
+					 [AC_MSG_ERROR([Need absolute path for --with-posix-shell, got '$with_posix_shell'.])])],
+			[POSIXSHELL=/bin/dash])
+AC_SUBST([POSIXSHELL])
+AC_MSG_RESULT([$POSIXSHELL])
 
 AC_PROG_INSTALL
 AC_PROG_MKDIR_P
diff --git a/peflagsall.in b/peflagsall.in
index d838201..6839db4 100644
--- a/peflagsall.in
+++ b/peflagsall.in
@@ -1,4 +1,4 @@
-#!/bin/@ASH@
+#!@POSIXSHELL@
 
 #
 # Copyright (c) 2009,2011 Charles Wilson
diff --git a/rebaseall.in b/rebaseall.in
index 076cc32..af4fe3f 100644
--- a/rebaseall.in
+++ b/rebaseall.in
@@ -1,4 +1,4 @@
-#!/bin/@ASH@
+#!@POSIXSHELL@
 
 #
 # Copyright (c) 2003, 2005, 2006, 2008, 2011, 2012 Jason Tishler
-- 
2.19.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]