From 0edc1a90713bd208ab48190cf1a1cae1158f6e7b Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 4 Jun 2012 09:02:05 -0400 Subject: Use declare -f over type -t to avoid subshells Signed-off-by: Dave Reisner --- functions | 2 +- mkinitcpio | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/functions b/functions index 14c6637..4a62d8e 100644 --- a/functions +++ b/functions @@ -633,7 +633,7 @@ run_build_hook() { return 1 fi - if [[ $(type -t build) != function ]]; then + if ! declare -f build >/dev/null; then error 'Hook '$script' has no build function' return 1 fi diff --git a/mkinitcpio b/mkinitcpio index e20dff5..c468835 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -178,7 +178,7 @@ while :; do shift if script=$(find_in_dirs "$1" "${INSTDIR[@]}"); then . "$script" - if [[ $(type -t help) != function ]]; then + if ! declare -f help >/dev/null; then error "No help for hook $1" exit 1 fi -- cgit v1.2.3-24-g4f1b