summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLPDB.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2016-04-21 00:31:43 +0000
committerNorbert Preining <preining@logic.at>2016-04-21 00:31:43 +0000
commit1bf271f3d5249f93f9c8f9b911f0a0ee0221194f (patch)
tree40852cc7dd20927ba6339e3e3d14197ea006cf30 /Master/tlpkg/TeXLive/TLPDB.pm
parent0977df7d314abf862bcbc9f0c231157c499e5016 (diff)
verification reporting reworked: be non-intrusive
git-svn-id: svn://tug.org/texlive/trunk@40640 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPDB.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm26
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: $!";