From 650958eaccd148987439f9bf75728bb0db208385 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 17 May 2016 14:32:03 +0000 Subject: checksum rework - die in tlchecksum if no checksum is defined - make sure that we call tlchecksum in TLPOBJ::make_container only if it is a system container (for some tlnet - not a backup one), or there is a checksum method defined - make sure that we don't call tlchecksum in tlmgr when making a container git-svn-id: svn://tug.org/texlive/trunk@41218 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLCrypto.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Master/tlpkg/TeXLive/TLCrypto.pm') diff --git a/Master/tlpkg/TeXLive/TLCrypto.pm b/Master/tlpkg/TeXLive/TLCrypto.pm index 7716f9eb292..29e7a2c5a41 100644 --- a/Master/tlpkg/TeXLive/TLCrypto.pm +++ b/Master/tlpkg/TeXLive/TLCrypto.pm @@ -68,6 +68,11 @@ Returns the checksum method or undef if none found. =cut sub setup_checksum_method { + # make it a noop if already defined + # the checksum method could also be "" meaning that there + # is none. We do not need to check again. Thus we check + # on defined. + return ($::checksum_method) if defined($::checksum_method); # default is no checksum $::checksum_method = ""; # for debugging @@ -122,11 +127,12 @@ Return checksum of C<$file>. sub tlchecksum { my ($file) = @_; - # no reason to have this here - # if (!$::checksum_method) { - # setup_checksum_method(); - # } - return "" if (!$::checksum_method); + # this is here for the case that a script forgets to + # set up the checksum method! + if (!$::checksum_method) { + setup_checksum_method(); + } + tldie("no checksum method available\n") if (!$::checksum_method); if (-r $file) { my ($out, $ret); if ($::checksum_method eq "openssl") { -- cgit v1.2.3