diff options
author | volth <volth@volth.com> | 2018-07-08 15:59:57 +0000 |
---|---|---|
committer | volth <volth@volth.com> | 2018-07-08 16:32:03 +0000 |
commit | 0de0ce58939932aee786679a86d08b5227732fab (patch) | |
tree | 2abe4a330f9f50616751ffa3600de7487a413b48 /pkgs/stdenv/generic/setup.sh | |
parent | 4bd4e3ef5c13c97ad829d18d8fe99dd753b33da5 (diff) |
substitute(): --subst-var was silently coercing to "" if the variable does not exist.
Diffstat (limited to 'pkgs/stdenv/generic/setup.sh')
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 87465df1482a..19dbdf8848e0 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -661,6 +661,10 @@ substituteStream() { echo "substituteStream(): ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." >&2 return 1 fi + if [ -z ${!varName+x} ]; then + echo "substituteStream(): ERROR: variable \$$varName is unset" >&2 + return 1 + fi pattern="@$varName@" replacement="${!varName}" ;; |