summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-01-16 10:15:59 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2015-01-16 10:15:59 -0800
commit8ac4bdbd7b752c6a0805559d4644824d1f5c9603 (patch)
treee6ad554ab7066fa558d7db0d5846010b59482211
parentMerge pull request #7 from dwfreed/fix-functions-sh (diff)
downloadnetifrc-8ac4bdbd7b752c6a0805559d4644824d1f5c9603.tar.gz
netifrc-8ac4bdbd7b752c6a0805559d4644824d1f5c9603.tar.bz2
netifrc-8ac4bdbd7b752c6a0805559d4644824d1f5c9603.zip
Speed up testing for e* commands.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--sh/functions.sh5
1 files 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