From b2789fe251264aceb4417b14edb31f8fe880b3e5 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 6 Jan 2016 04:21:13 +0000 Subject: debug and work on installation git-svn-id: svn://tug.org/texlive/trunk@39291 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLPDB.pm | 1 + Master/tlpkg/TeXLive/TLUtils.pm | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'Master/tlpkg') diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 134b4f4360b..15766d2950f 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -1655,6 +1655,7 @@ sub not_virtual_install_package { sub _install_data { my ($self, $what, $reloc, $filelistref, $totlpdb, $whatsize, $whatcheck) = @_; +printf STDERR "_install_data for $what whatsize $whatsize whatcheck $whatcheck\n"; my $target = $totlpdb->root; my $tempdir = "$target/temp"; 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; } -- cgit v1.2.3