diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-06-04 15:02:05 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-06-08 23:38:57 +0200 |
commit | 0edc1a90713bd208ab48190cf1a1cae1158f6e7b (patch) | |
tree | 1063445b3a2c18a13c5ec281f1767eb1a546b923 | |
parent | 5b99f78331f567cc1442460efc054b72c45306a6 (diff) | |
download | mkinitcpio-0edc1a90713bd208ab48190cf1a1cae1158f6e7b.tar.gz mkinitcpio-0edc1a90713bd208ab48190cf1a1cae1158f6e7b.tar.xz |
Use declare -f over type -t to avoid subshells
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r-- | functions | 2 | ||||
-rwxr-xr-x | mkinitcpio | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -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 @@ -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 |