commit: 8ac4bdbd7b752c6a0805559d4644824d1f5c9603 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> AuthorDate: Fri Jan 16 18:15:59 2015 +0000 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> CommitDate: Fri Jan 16 18:15:59 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/netifrc.git;a=commit;h=8ac4bdbd
Speed up testing for e* commands. Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> --- sh/functions.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sh/functions.sh b/sh/functions.sh index e209701..d907585 100644 --- a/sh/functions.sh +++ b/sh/functions.sh @@ -2,8 +2,7 @@ # systems. # First check whether e* commands are present in the environment -# XXX [[-n RC_GOT_FUNCTIONS]] ?? -if [ -n "$(command -v ebegin >/dev/null 2>&1)" ]; then +if [ x$RC_GOT_FUNCTIONS = xyes -o -n "$(command -v ebegin 2>/dev/null)" ]; then : # Then check for the presence of functions.sh @@ -16,6 +15,8 @@ else fi # runscript functions +# TODO: if another non-openrc system provides these in future, we have to +# change this structure. if [ "$INIT" != "openrc" ]; then # OpenRC functions used in depend