0021-timezone-Make-shell-interpreter-overridable-in-tzsel.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 8d5ff7357354394b958321204b75e3855781aefe Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Thu, 9 Dec 2021 15:14:42 -0800
  4. Subject: [PATCH] timezone: Make shell interpreter overridable in tzselect.ksh
  5. define new macro called KSHELL which can be used to define default shell
  6. use Bash by default
  7. Upstream-Status: Pending
  8. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  9. ---
  10. Makeconfig | 9 +++++++++
  11. timezone/Makefile | 1 +
  12. 2 files changed, 10 insertions(+)
  13. diff --git a/Makeconfig b/Makeconfig
  14. index ba70321af1..4b643768d9 100644
  15. --- a/Makeconfig
  16. +++ b/Makeconfig
  17. @@ -293,6 +293,15 @@ ifndef sysincludedir
  18. sysincludedir = /usr/include
  19. endif
  20. +# The full path name of a Posix-compliant shell, preferably one that supports
  21. +# the Korn shell's 'select' statement as an extension.
  22. +# These days, Bash is the most popular.
  23. +# It should be OK to set this to /bin/sh, on platforms where /bin/sh
  24. +# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
  25. +# is typically nicer if it works.
  26. +ifndef KSHELL
  27. +KSHELL = /bin/bash
  28. +endif
  29. # Commands to install files.
  30. ifndef INSTALL_DATA
  31. diff --git a/timezone/Makefile b/timezone/Makefile
  32. index a789c22d26..3e69409a94 100644
  33. --- a/timezone/Makefile
  34. +++ b/timezone/Makefile
  35. @@ -134,6 +134,7 @@ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
  36. -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
  37. -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
  38. -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
  39. + -e 's|#!/bin/bash|#!$(KSHELL)|g' \
  40. < $< > $@.new
  41. chmod 555 $@.new
  42. mv -f $@.new $@