diff options
author | Norbert Preining <preining@logic.at> | 2016-04-19 07:41:55 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2016-04-19 07:41:55 +0000 |
commit | ba2654a915a2b6dd6f9ad8c5598a63b5b5d2ff74 (patch) | |
tree | 313341b623e36667eca366a358d10a825496ff4b | |
parent | ffebcf561e94dd2699bf4bc0bd427ea44dfef174 (diff) |
only do the gpg magic when actually loading a remote tlpdb
git-svn-id: svn://tug.org/texlive/trunk@40615 c570f23f-e606-0410-a88d-b1316a301751
-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 |