diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index eb63b18e5f3dc..191abf7596bd9 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -17,8 +17,9 @@ runHook() { shift local var="$hookName" if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi - eval "local -a dummy=(\"\${$var[@]}\")" - for hook in "_callImplicitHook 0 $hookName" "${dummy[@]}"; do + local -n var + local hook + for hook in "_callImplicitHook 0 $hookName" "${var[@]}"; do _eval "$hook" "$@" done return 0 @@ -32,8 +33,9 @@ runOneHook() { shift local var="$hookName" if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi - eval "local -a dummy=(\"\${$var[@]}\")" - for hook in "_callImplicitHook 1 $hookName" "${dummy[@]}"; do + local -n var + local hook + for hook in "_callImplicitHook 1 $hookName" "${var[@]}"; do if _eval "$hook" "$@"; then return 0 fi |