summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg')
-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);