diff options
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 34f924fb2c0..b0235fd29c8 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -295,6 +295,7 @@ sub from_file { # remove the un-xz-ed tlpdb file from temp dir # THAT IS RACY!!! we should fix that in some better way with tempfile unlink($tlpdbfile) if $tlpdbfile; + close($retfh); return($found); } @@ -333,19 +334,12 @@ sub save { my $path = $self->location; mkdirhier(dirname($path)); my $tmppath = "$path.tmp"; - # - # on Windows we cannot move the stuff, at least I don't know how - if (win32()) { - open(FOO, ">$path") || die "$0: open(>$path) failed: $!"; - } else { - open(FOO, ">$tmppath") || die "$0: open(>$tmppath) failed: $!"; - } + open(FOO, ">$tmppath") || die "$0: open(>$tmppath) failed: $!"; $self->writeout(\*FOO); close(FOO); - if (unix()) { - # if we managed that one, we move it over - rename($tmppath, $path); - } + # if we managed that one, we move it over + die ("rename $tmppath to $path failed: $!") + unless rename($tmppath, $path); } =pod |