summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm22
1 files changed, 18 insertions, 4 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index d6bdcc27ea5..0b251b2f060 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -1340,6 +1340,8 @@ sub install_packages {
foreach my $h (@::install_packages_hook) {
&$h($n,$totalnr);
}
+ # TODO TODO
+ # we do NOT check the return value!!!
$fromtlpdb->install_package($package, $totlpdb);
$donesize += $tlpsizes{$package};
}
@@ -1960,7 +1962,8 @@ in case of success, otherwise undefined.
=cut
sub check_file {
- my ($xzfile, $checksum, $size);
+ my ($xzfile, $checksum, $size) = @_;
+ printf STDERR "checking $xzfile for size $size sum $checksum\n";
if ($checksum) {
if (tlmd5($xzfile) ne $checksum) {
tlwarn("Found $what in $tempdir, but hashsums differ, removing it.\n");
@@ -1969,13 +1972,13 @@ sub check_file {
} elsif ($size) {
my $filesize = (stat $xzfile)[7];
if ($filesize != $size) {
- tlwarn("Found $what in $tempdir, but sizes differ, removing it.\n");
+ tlwarn("Found $xzfile, but sizes differ, removing it.\n");
unlink($xzfile);
} else {
- tlwarn("Found $what in $tempdir with equal size, continuing fingers crossed.\n");
+ tlwarn("Found $xzfile, with equal size, continuing fingers crossed.\n");
}
} else {
- tlwarn("Found $what in $tempdir but no size or checksum information, removing it.\n");
+ tlwarn("Found $xzfile but no size or checksum information, removing it.\n");
unlink($xzfile);
}
}
@@ -1987,6 +1990,7 @@ sub unpack {
my $tempdir = (defined($opts{'tmpdir'}) ? $opts{'tmpdir'} : tl_tmpdir());
my $checksum = (defined($opts{'checksum'}) ? $opts{'checksum'} : 0);
my $size = (defined($opts{'size'}) ? $opts{'size'} : 0);
+ printf STDERR " unpack $what size $size checksum $checksum\n";
if (!defined($what)) {
tlwarn("TLUtils::unpack: nothing to unpack!\n");
@@ -2025,6 +2029,7 @@ sub unpack {
$xzfile_quote = "\"$xzfile\"";
$tarfile_quote = "\"$tarfile\"";
$target_quote = "\"$target\"";
+printf STDERR "BBB xzfile $xzfile for size $size sum $checksum\n";
if ($what =~ m,^(http|ftp)://,) {
# we are installing from the NET
# check for the presence of $what in $tempdir
@@ -2048,6 +2053,15 @@ sub unpack {
# we are installing from local compressed files
# copy it to temp
TeXLive::TLUtils::copy($what, $tempdir);
+printf STDERR "AAA xzfile $xzfile for size $size sum $checksum\n";
+
+ check_file($xzfile, $checksum, $size);
+ if (! -r $xzfile) {
+ tlwarn("Your local copy of\n");
+ tlwarn(" $what\n");
+ tlwarn("does fail consistency checks (see above). Stopping here.\n");
+ return;
+ }
# we can remove it afterwards
$remove_xzfile = 1;
}