diff options
author | Ulrich Müller <ulm@gentoo.org> | 2014-02-09 17:25:45 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2014-02-09 17:25:45 +0100 |
commit | 38614e63db2a5a124bc5971309c80c5c9533770e (patch) | |
tree | 4d4b2c792232ad783ef9a069720dc3c7f266806e /modules | |
parent | Recognise arm64 in package-manager lib. (diff) | |
download | eselect-38614e63db2a5a124bc5971309c80c5c9533770e.tar.gz eselect-38614e63db2a5a124bc5971309c80c5c9533770e.tar.bz2 eselect-38614e63db2a5a124bc5971309c80c5c9533770e.zip |
Do not source functions.sh in rc module, bug 373219.
* modules/rc.eselect (get_runlevel): Call "rc-status -r" directly,
in order to avoid sourcing functions.sh, bug 373219.
Remove baselayout-1 compatibility code.
(source_rc_functions): Remove function.
(do_show): Don't call source_rc_functions.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/rc.eselect | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/modules/rc.eselect b/modules/rc.eselect index a661445..dc8b0d5 100644 --- a/modules/rc.eselect +++ b/modules/rc.eselect @@ -7,22 +7,11 @@ inherit config DESCRIPTION="Manage /etc/init.d scripts in runlevels" MAINTAINER="eselect@gentoo.org" -# source_rc_functions PRIVATE -# API for OpenRC -source_rc_functions() { - [[ ${RC_GOT_FUNCTIONS} = yes ]] && return - source "${EPREFIX}/etc/init.d/functions.sh" \ - || die "Failed to source functions.sh" -} - # get_runlevel PRIVATE # determine the current runlevel -# this is only functional if source_rc_functions has been called before get_runlevel() { - if type rc_runlevel &>/dev/null; then - rc_runlevel || die "rc_runlevel failed" - elif [[ -n ${SOFTLEVEL} ]]; then - echo "${SOFTLEVEL}" + if type rc-status &>/dev/null; then + rc-status -r || die "rc_status failed" else die "Cannot determine runlevel" fi @@ -240,8 +229,6 @@ describe_show_options() { do_show() { local runlevel all unused n x - source_rc_functions - if [[ $# -eq 0 ]]; then set -- "$(get_runlevel)" else |