stdenv/setup.sh: make substitute* not drop EOF newline

This should solve #1982.
This commit is contained in:
Vladimír Čunát 2014-03-19 19:56:51 +01:00
parent 1ed628acb2
commit c4371afd06

View file

@ -304,9 +304,11 @@ substitute() {
local -a params=("$@")
local n p pattern replacement varName
local n p pattern replacement varName content
local content="$(cat $input)"
# a slightly hacky way to keep newline at the end
content="$(cat $input; echo -n X)"
content="${content%X}"
for ((n = 2; n < ${#params[*]}; n += 1)); do
p=${params[$n]}