stdenv-setup: Make the package accumulators associative arrays instead of strings

This is generally cleaner: less eval, less worrying about separators,
and probably also faster. I got the idea from that python wrapper
script.
This commit is contained in:
John Ericson
2017-07-11 16:04:14 -04:00
parent 3cb745d5a6
commit 8d76effc17
4 changed files with 16 additions and 19 deletions

View File

@@ -86,7 +86,7 @@ wrapPythonProgramsIn() {
_addToPythonPath() {
local dir="$1"
# Stop if we've already visited here.
if [ -n "${pythonPathsSeen[$dir]}" ]; then return; fi
[ -n "${pythonPathsSeen[$dir]}" ] || return 0
pythonPathsSeen[$dir]=1
# addToSearchPath is defined in stdenv/generic/setup.sh. It will have
# the effect of calling `export program_X=$dir/...:$program_X`.