sys-apps/openrc: Add bash use flag
authorWilliam Hubbs <william.hubbs@sony.com>
Thu, 14 Feb 2019 00:42:03 +0000 (18:42 -0600)
committerWilliam Hubbs <williamh@gentoo.org>
Thu, 14 Feb 2019 00:43:52 +0000 (18:43 -0600)
This experimentally allows service scripts to be written so that their
internal code is in bash. However, the OpenRC base code will stay in
posix sh, so it must be interfaced with using posix conventions.

Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.51, Repoman-2.3.12
Signed-off-by: William Hubbs <williamh@gentoo.org>
sys-apps/openrc/metadata.xml
sys-apps/openrc/openrc-9999.ebuild

index def8372055610fa4a4bdfed88d2d05bf1c4adf87..74ac5c680da11c5067e99b1bffa5847a63c23d18 100644 (file)
@@ -6,6 +6,9 @@
                <name>Gentoo OpenRC Project</name>
        </maintainer>
        <use>
+               <flag name="bash">
+                       enable the use of bash in service scripts (experimental)
+               </flag>
                <flag name="netifrc">enable Gentoo's network stack (net.* scripts)</flag>
                <flag name="newnet">enable the new network stack (experimental)</flag>
        </use>
index 60351506941eb684d7c5a6b1cb3703077b70d34a..1ad60296587abbd301bf626d56e0487a133e1d7a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -18,7 +18,7 @@ fi
 
 LICENSE="BSD-2"
 SLOT="0"
-IUSE="audit debug ncurses pam newnet prefix +netifrc selinux static-libs
+IUSE="audit bash debug ncurses pam newnet prefix +netifrc selinux static-libs
        unicode kernel_linux kernel_FreeBSD"
 
 COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
@@ -40,6 +40,7 @@ COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-proc
        !<sys-fs/udev-init-scripts-27"
 DEPEND="${COMMON_DEPEND}
        virtual/os-headers
+       bash? ( app-shells/bash )
        ncurses? ( virtual/pkgconfig )"
 RDEPEND="${COMMON_DEPEND}
        !prefix? (
@@ -79,7 +80,8 @@ src_compile() {
                MKAUDIT=$(usex audit)
                MKPAM=$(usev pam)
                MKSTATICLIBS=$(usex static-libs)
-               MKZSHCOMP=yes"
+               MKZSHCOMP=yes
+               SH=$(usex bash /bin/bash /bin/sh)"
 
        local brand="Unknown"
        if use kernel_linux ; then