summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-02-23 23:05:02 +0000
committerKarl Berry <karl@freefriends.org>2019-02-23 23:05:02 +0000
commit0c8e0812140de740c21f66df8827010d1323311c (patch)
tree2d6ba6e8a0d3b8e2336d1a0037aa3199e33935d5
parent389adc225b81ce6f44e82455cd7ec72402c2ed13 (diff)
(copy): die or warn in more failure cases.
(unpack): remove_container -> remove_containerfile name. git-svn-id: svn://tug.org/texlive/trunk@50107 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm20
1 files changed, 13 insertions, 7 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index cce5af67328..01fab4c90f0 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -1137,10 +1137,14 @@ sub copy {
$outfile = "$destdir/$filename";
}
- mkdirhier ($destdir) unless -d "$destdir";
+ if (! -d $destdir) {
+ my ($ret,$err) = mkdirhier ($destdir);
+ die "mkdirhier($destdir) failed: $err\n" if ! $ret;
+ }
if (-l "$infile") {
- symlink (readlink $infile, "$destdir/$filename");
+ symlink (readlink $infile, "$destdir/$filename")
+ || die "symlink(readlink $infile, $destdir/$filename) failed: $!";
} else {
if (! open (IN, $infile)) {
warn "open($infile) failed, not copying: $!";
@@ -1148,13 +1152,13 @@ sub copy {
}
binmode IN;
- $mode = (-x "$infile") ? oct("0777") : oct("0666");
+ $mode = (-x $infile) ? oct("0777") : oct("0666");
$mode &= ~umask;
open (OUT, ">$outfile") || die "open(>$outfile) failed: $!";
binmode OUT;
- chmod $mode, "$outfile";
+ chmod ($mode, $outfile) || warn "chmod($mode,$outfile) failed: $!";
while ($read = sysread (IN, $buffer, $blocksize)) {
die "read($infile) failed: $!" unless defined $read;
@@ -1167,8 +1171,9 @@ sub copy {
}
}
close (OUT) || warn "close($outfile) failed: $!";
- close IN || warn "close($infile) failed: $!";;
- @stat = lstat ("$infile");
+ close (IN) || warn "close($infile) failed: $!";;
+ @stat = lstat ($infile);
+ die "lstat($infile) failed: $!" if ! @stat;
utime ($stat[8], $stat[9], $outfile);
}
}
@@ -2224,7 +2229,8 @@ sub unpack {
# we can remove it afterwards
$remove_containerfile = 1;
}
- if (!system_pipe($decompressor, $containerfile, $tarfile, $remove_container, @decompressorArgs)
+ if (!system_pipe($decompressor, $containerfile, $tarfile,
+ $remove_containerfile, @decompressorArgs)
||
! -f $tarfile) {
unlink($tarfile, $containerfile);