diff options
author | Dan Peebles <pumpkin@me.com> | 2017-07-24 13:09:32 -0400 |
---|---|---|
committer | Dan Peebles <pumpkin@me.com> | 2017-07-24 13:09:32 -0400 |
commit | 2829ea57cbf55cc92b5c1637296fc889985d6628 (patch) | |
tree | 3d3072856b91cd17609e86c7af9821bb695ec41b /pkgs/stdenv | |
parent | 1dd6e7dcbc4ea5ac71815e95b050b45c046d7745 (diff) | |
download | nixlib-2829ea57cbf55cc92b5c1637296fc889985d6628.tar nixlib-2829ea57cbf55cc92b5c1637296fc889985d6628.tar.gz nixlib-2829ea57cbf55cc92b5c1637296fc889985d6628.tar.bz2 nixlib-2829ea57cbf55cc92b5c1637296fc889985d6628.tar.lz nixlib-2829ea57cbf55cc92b5c1637296fc889985d6628.tar.xz nixlib-2829ea57cbf55cc92b5c1637296fc889985d6628.tar.zst nixlib-2829ea57cbf55cc92b5c1637296fc889985d6628.zip |
stdenv/setup.sh: undo `local -n` change
It's better than the eval solution this is adding back, but until we can rely on a particular version of bash in nix-shell, this just breaks too much stuff. See https://github.com/NixOS/nix/commit/c94f3d5575d7af5403274d1e9e2f3c9d72989751 and https://github.com/NixOS/nix/pull/1483 for the better long-term solution.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index e5d2ba8682de..b48b49c0ad1b 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -17,9 +17,10 @@ runHook() { shift local var="$hookName" if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi - local -n var + + eval "local -a dummy=(\"\${$var[@]}\")" local hook - for hook in "_callImplicitHook 0 $hookName" "${var[@]}"; do + for hook in "_callImplicitHook 0 $hookName" "${dummy[@]}"; do _eval "$hook" "$@" done return 0 @@ -33,9 +34,9 @@ runOneHook() { shift local var="$hookName" if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi - local -n var + eval "local -a dummy=(\"\${$var[@]}\")" local hook - for hook in "_callImplicitHook 1 $hookName" "${var[@]}"; do + for hook in "_callImplicitHook 1 $hookName" "${dummy[@]}"; do if _eval "$hook" "$@"; then return 0 fi |