mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 18:33:00 +00:00
Revert "setup.sh: fatal: This word should yield a string, but it contains an array"
This reverts commit bf99a819a1
.
It caused regressions in some packages; see:
https://github.com/NixOS/nixpkgs/commit/bf99a819a160
This commit is contained in:
parent
3ea417e47f
commit
6f239d7309
@ -368,13 +368,16 @@ findInputs() {
|
|||||||
local var="${!varRef}"
|
local var="${!varRef}"
|
||||||
unset -v varVar varRef
|
unset -v varVar varRef
|
||||||
|
|
||||||
# var is a reference to an array and can sometimes be undefined
|
# TODO(@Ericson2314): Restore using associative array once Darwin
|
||||||
# so checking the array with "${!var}[@]" does not work
|
# nix-shell doesn't use impure bash. This should replace the O(n)
|
||||||
# check if $pkgs is in the var ref array
|
# case with an O(1) hash map lookup, assuming bash is implemented
|
||||||
# TODO(@Ericson2314): Restore using associative array
|
# well :D.
|
||||||
if [[ "${var}[*]" = *" $pkg "* ]]; then
|
local varSlice="${var}[*]"
|
||||||
return 0
|
# ${..-} to hack around old bash empty array problem
|
||||||
fi
|
case "${!varSlice-}" in
|
||||||
|
*" $pkg "*) return 0 ;;
|
||||||
|
esac
|
||||||
|
unset -v varSlice
|
||||||
|
|
||||||
eval "$var"'+=("$pkg")'
|
eval "$var"'+=("$pkg")'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user