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