mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
stdenv substitute: avoid using a temporary file
- IMO using a temporary is not needed here (anymore), - temporary at that location can cause a problem (in a specific case): for example, when using the substituteAll function from nixpkgs on a single file directly under /nix/store/ (or ./foo-file), the stdenv's substitute tries to create a temporary directly under /nix/store, which causes problems on chrooted darwin (according to @copumpkin earlier today on IRC)
This commit is contained in:
parent
9b7b2ce8eb
commit
2533a11241
@ -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"
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user