From d64c9d205083ca82823f9f5ff178a5581f6c8b2a Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 7 Feb 2019 17:08:12 -0600 Subject: [PATCH] add experimental support for an alternate shell for service scripts This is for #288. --- NEWS.md | 7 +++++++ README.md | 1 + mk/scripts.mk | 2 +- sh/gendepends.sh.in | 2 +- sh/openrc-run.sh.in | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 0378a08e..ffb74f97 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,13 @@ OpenRC NEWS This file will contain a list of notable changes for each release. Note the information in this file is in reverse order. +## OpenRC 0.41. + +This version adds an experimental build time switch to allow setting the +default shell to use for service scripts. +By default, this is set to /bin/sh if it is changed, the new shell must +be able to understand posix-compatible syntax. + ## OpenRC 0.40 In this version, the keymaps and termencoding services on Linux needed diff --git a/README.md b/README.md index 584547ea..61d9ac7f 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ PKG_PREFIX=/usr/pkg LOCAL_PREFIX=/usr/local PREFIX=/usr/local BRANDING=\"Gentoo/$(uname -s)\" +SH=/bin/sh ``` ## Notes diff --git a/mk/scripts.mk b/mk/scripts.mk index 29babf9c..40cb4d65 100644 --- a/mk/scripts.mk +++ b/mk/scripts.mk @@ -19,7 +19,7 @@ _PKG_SED:= $(shell ${_PKG_SED_SH}) _LCL_SED_SH= if test "${PREFIX}" = "${LOCAL_PREFIX}"; then echo "-e 's:@LOCAL_PREFIX@::g'"; else echo "-e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'"; fi _LCL_SED:= $(shell ${_LCL_SED_SH}) -SED_REPLACE= -e 's:@LIB@:${LIBNAME}:g' -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' -e 's:@PREFIX@:${PREFIX}:g' -e 's:@BINDIR@:${BINDIR}:g' -e 's:@SBINDIR@:${SBINDIR}:g' ${_PKG_SED} ${_LCL_SED} +SED_REPLACE= -e 's:@SHELL@:${SH}:' -e 's:@LIB@:${LIBNAME}:g' -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' -e 's:@PREFIX@:${PREFIX}:g' -e 's:@BINDIR@:${BINDIR}:g' -e 's:@SBINDIR@:${SBINDIR}:g' ${_PKG_SED} ${_LCL_SED} # Tweak our shell scripts %.sh: %.sh.in diff --git a/sh/gendepends.sh.in b/sh/gendepends.sh.in index 6ecec6b7..45147e6a 100644 --- a/sh/gendepends.sh.in +++ b/sh/gendepends.sh.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@SHELL@ # Shell wrapper to list our dependencies # Copyright (c) 2007-2015 The OpenRC Authors. diff --git a/sh/openrc-run.sh.in b/sh/openrc-run.sh.in index 20c1b8ad..7e9064c2 100644 --- a/sh/openrc-run.sh.in +++ b/sh/openrc-run.sh.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@SHELL@ # Shell wrapper for openrc-run # Copyright (c) 2007-2015 The OpenRC Authors.