summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-13 23:16:40 +0000
committerKarl Berry <karl@freefriends.org>2016-04-13 23:16:40 +0000
commit4f1866f03ec88d94b78ca954bd3f3b7b40ed168b (patch)
tree54da397059fb834600fb3498b3fc4bc8f17f6be9 /Master/tlpkg/TeXLive/TLUtils.pm
parent99ed44506a5f4e2aec5ebc7fd0028ecdd88771b4 (diff)
(check_file): report info when checksums or sizes differ.
git-svn-id: svn://tug.org/texlive/trunk@40494 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm17
1 files changed, 10 insertions, 7 deletions
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<check_file($what, $checksum, $checksize>
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;
}