summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc/0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch
blob: 24dd4dad562d44e72765a07dfbbff8dbb30320b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 99aac9db31f52c3b59b32c424b26d881069aa5df Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 9 Dec 2021 15:14:42 -0800
Subject: [PATCH] timezone: Make shell interpreter overridable in tzselect.ksh

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

Upstream-Status: Pending
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 2d4343b604..1992e19c4e 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -309,6 +309,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 cf4ef3bf7e..559b9a7e3d 100644
--- a/timezone/Makefile
+++ b/timezone/Makefile
@@ -143,6 +143,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 $@