summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2016-01-06 04:21:13 +0000
committerNorbert Preining <preining@logic.at>2016-01-06 04:21:13 +0000
commitb2789fe251264aceb4417b14edb31f8fe880b3e5 (patch)
treedff51f177b91ba8b84dd98def2e70c25a81835cb /Master/tlpkg/TeXLive/TLUtils.pm
parent79eaa5997daa14b6940606c58ae785c591e25d80 (diff)
debug and work on installation
git-svn-id: svn://tug.org/texlive/trunk@39291 c570f23f-e606-0410-a88d-b1316a301751
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;
}