summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-04-19 16:47:09 +0000
committerRoy Marples <roy@marples.name>2009-04-19 16:47:09 +0000
commite2942e34af370f6710661597aee5f750e2562f3c (patch)
treefd10032d134e47c663debd5b0da9883b80208c23 /sh
parentbbd810425b819318fda48f390fec818c20bbff39 (diff)
downloadopenrc-e2942e34af370f6710661597aee5f750e2562f3c.tar.gz
openrc-e2942e34af370f6710661597aee5f750e2562f3c.tar.bz2
openrc-e2942e34af370f6710661597aee5f750e2562f3c.tar.xz
Use a bashism for a minor speedup in gendepends.sh
Diffstat (limited to 'sh')
-rw-r--r--sh/functions.sh.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/sh/functions.sh.in b/sh/functions.sh.in
index 57917ed..acf37e4 100644
--- a/sh/functions.sh.in
+++ b/sh/functions.sh.in
@@ -59,13 +59,18 @@ _sanitize_path()
}
# Allow our scripts to support zsh
-if [ -n "${ZSH_VERSION}" ]; then
+if [ -n "$ZSH_VERSION" ]; then
emulate sh
NULLCMD=:
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
fi
+# Use a special shell feature to save forking
+if [ -n "$BASH_VERSION" -o "$ZSH_VERSION" ]; then
+ shell_var() { LC_ALL=C echo "${@//[![:word:]]/_}"; }
+fi
+
# Make a sane PATH
_PREFIX=@PREFIX@
_PKG_PREFIX=@PKG_PREFIX@