From 4f1866f03ec88d94b78ca954bd3f3b7b40ed168b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 13 Apr 2016 23:16:40 +0000 Subject: (check_file): report info when checksums or sizes differ. git-svn-id: svn://tug.org/texlive/trunk@40494 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Master/tlpkg') diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 6d02404fb48..fc05caa5c70 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -1960,23 +1960,26 @@ sub w32_remove_from_path { =item C Remove C<$what> if either the given C<$checksum> or C<$checksize> does -not agree. Does nothing if neither of the check arguments is given. +not agree. If a check argument is not given, that check is not performed. =cut sub check_file { - my ($xzfile, $checksum, $size) = @_; + my ($xzfile, $checksum, $checksize) = @_; if ($checksum) { - if (tlchecksum($xzfile) ne $checksum) { - tlwarn("TLUtils::check_file: found $xzfile, but hashsums differ, removing it.\n"); + my $tlchecksum = tlchecksum($xzfile); + if ($tlchecksum ne $checksum) { + tlwarn("TLUtils::check_file: removing $xzfile, checksums differ:\n"); + tlwarn("TLUtils::check_file: TL=$tlchecksum, arg=$checksum\n"); unlink($xzfile); return; } } - if ($size) { + if ($checksize) { my $filesize = (stat $xzfile)[7]; - if ($filesize != $size) { - tlwarn("TLUtils::check_file: found $xzfile, but sizes differ, removing it.\n"); + if ($filesize != $checksize) { + tlwarn("TLUtils::check_file: removing $xzfile, sizes differ:\n"); + tlwarn("TLUtils::check_file: TL=$filesize, arg=$checksize\n"); unlink($xzfile); return; } -- cgit v1.2.3