From 7107e83a7273b3c06133408efe1cbc040dbbe3db Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 24 Aug 2009 15:09:06 +0000 Subject: make saving the tlpdb more robust git-svn-id: svn://tug.org/texlive/trunk@14843 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLPDB.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Master/tlpkg/TeXLive') 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 -- cgit v1.2.3