]> git.donarmstrong.com Git - bugscan.git/commitdiff
Make the britney count files more-or-less atomically updated.
authorSteinar H. Gunderson <sesse@rietz>
Mon, 18 Jun 2007 14:14:30 +0000 (14:14 +0000)
committerSteinar H. Gunderson <sesse@rietz>
Mon, 18 Jun 2007 14:14:30 +0000 (14:14 +0000)
make-britney-counts

index 9a784329c630861c931dc71873a3ac57cf779231..648ec2f6a5720d7d2a7c0a349fef2b6ff602679e 100755 (executable)
@@ -55,19 +55,24 @@ for my $bug (values %scanlib::bugs) {
        }
 }
 
-open TESTING, ">", "britney/testing"
-       or die "britney/testing: $!";
+open TESTING, ">", "britney/testing.new"
+       or die "britney/testing.new: $!";
 for my $pkg (sort keys %testingbugs) {
        print TESTING "$pkg $testingbugs{$pkg}\n";
 }
 close TESTING;
 
-open UNSTABLE, ">", "britney/unstable"
-       or die "britney/unstable: $!";
+open UNSTABLE, ">", "britney/unstable.new"
+       or die "britney/unstable.new: $!";
 for my $pkg (sort keys %unstablebugs) {
        print UNSTABLE "$pkg $unstablebugs{$pkg}\n";
 }
 close UNSTABLE;
 
+rename "britney/testing.new", "britney/testing"
+       or die "renaming britney/testing.new to britney/testing: $!";
+rename "britney/unstable.new", "britney/unstable"
+       or die "renaming britney/unstable.new to britney/unstable: $!";
+
 exit 0;