diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPDB.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index aa2c7f51040..b82d747c2bb 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -51,6 +51,7 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages $tlpdb->location; $tlpdb->platform; $tlpdb->is_verified; + $tlpdb->verification_status; $tlpdb->config_src_container; $tlpdb->config_doc_container; $tlpdb->config_container_format; @@ -270,6 +271,7 @@ sub from_file { } else { $self->root($root_from_path); } + $self->verification_status("unknown"); my $retfh; my $tlpdbfile; my $is_verified = 0; @@ -373,10 +375,16 @@ sub from_file { tldie("$0: connection problems, cannot download: $m\n"); } elsif ($r == -2) { debug("$0: remote database checksum is not signed, continuing anyway!\n"); + $self->verification_status("not signed"); } elsif ($r == -3) { debug("$0: TLPDB: no gpg available, continuing anyway!\n"); + $self->verification_status("gnupg not available"); + } elsif ($r == -4) { + debug("$0: TLPDB: pubkey missing, continuing anyway!\n"); + $self->verification_status("pubkey missing"); } elsif ($r == 0) { $is_verified = 1; + $self->verification_status("verified"); } else { tldie("$0: unexpected return value from verify_checksum: $r\n"); } @@ -393,8 +401,13 @@ sub from_file { tldie("$0: connection problems, cannot download: $m\n"); } elsif ($r == -2) { debug("$0: remote database checksum is not signed, continuing anyway!\n"); + $self->verification_status("not signed"); } elsif ($r == -3) { debug("$0: TLPDB: no gpg available, continuing anyway!\n"); + $self->verification_status("gnupg not available"); + } elsif ($r == -4) { + debug("$0: TLPDB: pubkey missing, continuing anyway!\n"); + $self->verification_status("pubkey missing"); } elsif ($r == 0) { $is_verified = 1; } else { @@ -1160,6 +1173,24 @@ sub is_verified { if (@_) { $self->{'verified'} = shift } return $self->{'verified'}; } +=pod + +=item C<< $tlpdb->verification_status >> + +Returns a short textual explanation of the verification status. +In particular if the database is not verified, it returns the reason. + +=cut + +sub verification_status { + my $self = shift; + if ($self->is_virtual) { + tlwarn("TLPDB: cannot set/edit verification status of a virtual tlpdb\n"); + return 0; + } + if (@_) { $self->{'verification_status'} = shift } + return $self->{'verification_status'}; +} =pod |