diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPDB.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index a3c22358000..65999bfc9a5 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -368,18 +368,32 @@ sub from_file { # before we open and proceed, verify the downloaded file if ($params{'verify'} && $media ne 'local_uncompressed') { my ($r, $m) = TeXLive::TLUtils::verify_checksum($tlpdbfile, "$path.$TeXLive::TLConfig::ChecksumExtension"); - # TODO here we could check for -1 as return value - # which would indicate that the checksum could not be downloaded! - if ($r != 0) { - tldie("$0: verification of $tlpdbfile from $path failed ($r): $m\n"); + if ($r == 1) { + tldie("$0: checksum error when downloading $tlpdbfile from $path: $m\n"); + } elsif ($r == 2) { + tldie("$0: signature verification error of $tlpdbfile from $path: $m\n"); + } elsif ($r == -1) { + tldie("$0: connection problems, cannot download: $m\n"); + } elsif ($r == 0) { + # all is fine, do nothing + } else { + tldie("$0: unexpected return value from verify_checksum: $r\n"); } } open($retfh, "<$tlpdbfile") || die "$0: open($tlpdbfile) failed: $!"; } else { if ($params{'verify'} && $media ne 'local_uncompressed') { my ($r, $m) = TeXLive::TLUtils::verify_checksum($path, "$path.$TeXLive::TLConfig::ChecksumExtension"); - if ($r != 0) { - tldie("$0: verification of $path failed ($r): $m\n"); + if ($r == 1) { + tldie("$0: checksum error when downloading $tlpdbfile from $path: $m\n"); + } elsif ($r == 2) { + tldie("$0: signature verification error of $tlpdbfile from $path: $m\n"); + } elsif ($r == -1) { + tldie("$0: connection problems, cannot download: $m\n"); + } elsif ($r == 0) { + # all is fine, do nothing + } else { + tldie("$0: unexpected return value from verify_checksum: $r\n"); } } open(TMP, "<$path") || die "$0: open($path) failed: $!"; |