public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] timezone: Make shell interpreter overridable in tzselect.ksh
@ 2021-12-09 23:40 Khem Raj
  2021-12-10  1:42 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2021-12-09 23:40 UTC (permalink / raw)
  To: libc-alpha

define new macro called KSHELL which can be used to define default shell
use Bash by default

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 Makeconfig        | 9 +++++++++
 timezone/Makefile | 1 +
 2 files changed, 10 insertions(+)

diff --git a/Makeconfig b/Makeconfig
index 3fa2f13003..a1ea5d5571 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -292,6 +292,15 @@ ifndef sysincludedir
 sysincludedir = /usr/include
 endif
 
+# The full path name of a Posix-compliant shell, preferably one that supports
+# the Korn shell's 'select' statement as an extension.
+# These days, Bash is the most popular.
+# It should be OK to set this to /bin/sh, on platforms where /bin/sh
+# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
+# is typically nicer if it works.
+ifndef KSHELL
+KSHELL = /bin/bash
+endif
 
 # Commands to install files.
 ifndef INSTALL_DATA
diff --git a/timezone/Makefile b/timezone/Makefile
index c624a189b3..dc8f5277de 100644
--- a/timezone/Makefile
+++ b/timezone/Makefile
@@ -127,6 +127,7 @@ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
 	    -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
 	    -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
 	    -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
+	    -e 's|#!/bin/bash|#!$(KSHELL)|g' \
 	    < $< > $@.new
 	chmod 555 $@.new
 	mv -f $@.new $@
-- 
2.34.1


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

* Re: [PATCH] timezone: Make shell interpreter overridable in tzselect.ksh
  2021-12-09 23:40 [PATCH] timezone: Make shell interpreter overridable in tzselect.ksh Khem Raj
@ 2021-12-10  1:42 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2021-12-10  1:42 UTC (permalink / raw)
  To: Khem Raj; +Cc: libc-alpha

Thanks, this patch looks good to me.

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

end of thread, other threads:[~2021-12-10  1:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 23:40 [PATCH] timezone: Make shell interpreter overridable in tzselect.ksh Khem Raj
2021-12-10  1:42 ` Paul Eggert

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