Merge pull request #5714 from vcunat/p/stdenv-subst

stdenv substitute: avoid using a temporary file
This commit is contained in:
Wout Mertens 2015-01-23 23:15:16 +01:00
commit 4b82bd683e

View File

@ -370,9 +370,8 @@ substitute() {
content="${content//"$pattern"/$replacement}"
done
printf "%s" "$content" > "$output".tmp
if [ -x "$output" ]; then chmod +x "$output".tmp; fi
mv -f "$output".tmp "$output"
chmod -f +w "$output" || true
printf "%s" "$content" > "$output"
}