generic/setup.sh: allow clobbering env-vars file

If the option ‘noclobber’ is set in Bash, we get an error when we
clobber an already existing env-vars. This is an okay error to ignore,
so just >| instead. Note that >| is NOT a Bashism[[1]].

Fixes #79651

[1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_02
gstqt5
Matthew Bauer 2020-04-09 19:18:33 -04:00
parent 7b5b815c3b
commit e0fb0df64f
1 changed files with 1 additions and 1 deletions

View File

@ -779,7 +779,7 @@ substituteAllInPlace() {
# the environment used for building.
dumpVars() {
if [ "${noDumpEnvVars:-0}" != 1 ]; then
export > "$NIX_BUILD_TOP/env-vars" || true
export >| "$NIX_BUILD_TOP/env-vars" || true
fi
}