summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-08-24 15:09:06 +0000
committerNorbert Preining <preining@logic.at>2009-08-24 15:09:06 +0000
commit7107e83a7273b3c06133408efe1cbc040dbbe3db (patch)
treec424ea934d31258dcfe94238b319640cd38f47b5 /Master/tlpkg/TeXLive
parentef25c8b05ebf306c2784252cb15ea6c3b7bfe8cf (diff)
make saving the tlpdb more robust
git-svn-id: svn://tug.org/texlive/trunk@14843 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index c2780c8c647..ca4c1b496df 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -332,9 +332,12 @@ sub save {
my $self = shift;
my $path = $self->location;
mkdirhier(dirname($path));
- open(FOO, ">$path") || die "$0: open(>$path) failed: $!";
+ my $tmppath = "$path.tmp";
+ open(FOO, ">$tmppath") || die "$0: open(>$tmppath) failed: $!";
$self->writeout(\*FOO);
close(FOO);
+ # if we managed that one, we move it over
+ rename($tmppath, $path);
}
=pod