diff options
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 97 |
1 files changed, 50 insertions, 47 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index c6218f3d6d9..249cae4f210 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -622,53 +622,6 @@ for the full story.\n"; } } - # setup gpg if available - # by default we setup gpg - { - # default value - my $do_setup_gpg = 1; - # the value is set in the config file - if (defined($config{'verify-downloads'})) { - $do_setup_gpg = $config{'verify-downloads'}; - } - # command line - if (defined($opts{'verify-downloads'})) { - $do_setup_gpg = $opts{'verify-downloads'}; - } - # now we know whether we setup gpg or not - if ($do_setup_gpg) { - if (TeXLive::TLUtils::setup_gpg($Master)) { - log("will verify cryptographic signatures\n") - } else { - my $prefix = "$prg: No gpg found"; # just to shorten the strings - if ($opts{'verify-downloads'}) { - # verification was requested on the command line, but did not succeed, die - tldie("$prefix, verification explicitly requested on command line, quitting.\n"); - } - if ($config{'verify-downloads'}) { - # verification explicitely requested in config file, but not gpg, die - tldie("$prefix, verification explicitly requested in config file, quitting.\n"); - } - # it was requested via the default setting, so just warn - info ("$prefix, verification implicitly requested, " - . "continuing without verification\n"); - } - } else { - # we do not setup gpg: when explicitly requested, be silent, otherwise info - my $prefix = "$prg: not setting up gpg"; - if (defined($opts{'verify-downloads'})) { - # log normally is *NOT* logged to a file - # tlmgr does by default *NOT* set up a log file (cmd line option) - # user requested it, so don't bother with output - log("$prefix, requested on command line\n"); - } elsif (defined($config{'verify-downloads'})) { - log("$prefix, requested in config file\n"); - } else { - tldie("$prg: how could this happen? gpg setup.\n"); - } - } - } - my $ret = execute_action($action, @ARGV); # F_ERROR stops processing immediately, and prevents postactions from @@ -5741,6 +5694,53 @@ sub init_local_db { } } +sub handle_gpg_config_settings { + # setup gpg if available + # by default we setup gpg + # default value + my $do_setup_gpg = 1; + # the value is set in the config file + if (defined($config{'verify-downloads'})) { + $do_setup_gpg = $config{'verify-downloads'}; + } + # command line + if (defined($opts{'verify-downloads'})) { + $do_setup_gpg = $opts{'verify-downloads'}; + } + # now we know whether we setup gpg or not + if ($do_setup_gpg) { + if (TeXLive::TLUtils::setup_gpg($Master)) { + log("will verify cryptographic signatures\n") + } else { + my $prefix = "$prg: No gpg found"; # just to shorten the strings + if ($opts{'verify-downloads'}) { + # verification was requested on the command line, but did not succeed, die + tldie("$prefix, verification explicitly requested on command line, quitting.\n"); + } + if ($config{'verify-downloads'}) { + # verification explicitely requested in config file, but not gpg, die + tldie("$prefix, verification explicitly requested in config file, quitting.\n"); + } + # it was requested via the default setting, so just warn + info ("$prefix, verification implicitly requested, " + . "continuing without verification\n"); + } + } else { + # we do not setup gpg: when explicitly requested, be silent, otherwise info + my $prefix = "$prg: not setting up gpg"; + if (defined($opts{'verify-downloads'})) { + # log normally is *NOT* logged to a file + # tlmgr does by default *NOT* set up a log file (cmd line option) + # user requested it, so don't bother with output + log("$prefix, requested on command line\n"); + } elsif (defined($config{'verify-downloads'})) { + log("$prefix, requested in config file\n"); + } else { + tldie("$prg: how could this happen? gpg setup.\n"); + } + } +} + # initialize the global $remotetlpdb object, or die. # uses the global $location. @@ -5766,6 +5766,9 @@ sub init_tlmedia { $localtlpdb->save; %repos = repository_to_array($location); } + # do the gpg stuff only when loading the remote tlpdb + handle_gpg_config_settings(); + # check if we are only one tag/repo if ($#tags == 0) { # go to normal mode |