public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: libc-alpha@sourceware.org
Subject: [PATCH] timezone: Make shell interpreter overridable in tzselect.ksh
Date: Thu,  9 Dec 2021 15:40:15 -0800	[thread overview]
Message-ID: <20211209234015.1554552-1-raj.khem@gmail.com> (raw)

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


             reply	other threads:[~2021-12-09 23:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 23:40 Khem Raj [this message]
2021-12-10  1:42 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211209234015.1554552-1-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).