mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
* Atomic file replacement is good.
This commit is contained in:
parent
e1e9c036f9
commit
2fdb27e7f2
2 changed files with 14 additions and 3 deletions
|
@ -146,7 +146,7 @@ sub writeManifest
|
|||
my $patches = shift;
|
||||
my $successors = shift;
|
||||
|
||||
open MANIFEST, ">$manifest";
|
||||
open MANIFEST, ">$manifest.tmp"; # !!! check exclusive
|
||||
|
||||
foreach my $storePath (keys %{$narFiles}) {
|
||||
my $narFileList = $$narFiles{$storePath};
|
||||
|
@ -184,6 +184,9 @@ sub writeManifest
|
|||
|
||||
|
||||
close MANIFEST;
|
||||
|
||||
rename("$manifest.tmp", $manifest)
|
||||
or die "cannot rename $manifest.tmp: $!";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue