···101 if [ -n "$succeedOnFailure" ]; then
102 echo "build failed with exit code $exitCode (ignored)"
103 mkdir -p "$out/nix-support"
104- echo -n $exitCode > "$out/nix-support/failed"
105 exit 0
106 fi
107···339 local n p pattern replacement varName content
340341 # a slightly hacky way to keep newline at the end
342- content="$(cat "$input"; echo -n X)"
343 content="${content%X}"
344345 for ((n = 2; n < ${#params[*]}; n += 1)); do
···367 content="${content//"$pattern"/$replacement}"
368 done
369370- # !!! This doesn't work properly if $content is "-n".
371- echo -n "$content" > "$output".tmp
372 if [ -x "$output" ]; then chmod +x "$output".tmp; fi
373 mv -f "$output".tmp "$output"
374}
···101 if [ -n "$succeedOnFailure" ]; then
102 echo "build failed with exit code $exitCode (ignored)"
103 mkdir -p "$out/nix-support"
104+ printf "%s" $exitCode > "$out/nix-support/failed"
105 exit 0
106 fi
107···339 local n p pattern replacement varName content
340341 # a slightly hacky way to keep newline at the end
342+ content="$(cat "$input"; printf "%s" X)"
343 content="${content%X}"
344345 for ((n = 2; n < ${#params[*]}; n += 1)); do
···367 content="${content//"$pattern"/$replacement}"
368 done
369370+ printf "%s" "$content" > "$output".tmp
0371 if [ -x "$output" ]; then chmod +x "$output".tmp; fi
372 mv -f "$output".tmp "$output"
373}