about summary refs log tree commit diff
path: root/scripts/readmanifest.pm.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/readmanifest.pm.in')
-rw-r--r--scripts/readmanifest.pm.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/readmanifest.pm.in b/scripts/readmanifest.pm.in
index 766aa4219944..31ea5f43cc56 100644
--- a/scripts/readmanifest.pm.in
+++ b/scripts/readmanifest.pm.in
@@ -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: $!";
 }