diff options
author | Norbert Preining <preining@logic.at> | 2018-04-01 00:49:33 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2018-04-01 00:49:33 +0000 |
commit | 3c2d2b0110e4582b5274489bff0165e37f09831f (patch) | |
tree | 38f463d5bc5fb05bb1e1c1351d4d8dda0bebedde /Master/texmf-dist | |
parent | 9608b5e0260973d80366d0aebddd8e625fef9d76 (diff) |
more fixes for new --verify-repo setting
git-svn-id: svn://tug.org/texlive/trunk@47213 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index 9b7878aacb3..b7a1d49057b 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -28,6 +28,7 @@ our $tlmgr_config_file; our $pinfile; our $action; # for the pod2usage -sections call our %opts; +our $allowed_verify_args_regex = qr/^(none|main|all)$/i; END { if ($opts{"pause"}) { @@ -480,17 +481,21 @@ sub main { $action = "remove"; } + # + # check for correctness of verify-repo argument + if (defined($opts{"verify-repo"}) && + ($opts{"verify-repo"} !~ m/$allowed_verify_args_regex/)) { + tldie("$prg: unknown value for --verify-repo: $opts{'verify-repo'}\n"); + } # convert command line crypto options $opts{"verify-repo"} = convert_crypto_options($opts{"verify-downloads"}, $opts{"require-verification"}, $opts{"verify-repo"}); + if (defined($opts{"verify-downloads"}) || defined($opts{"require-verification"})) { + tlwarn("$prg: please use -verify-repo options instead of verify-downloads/require-verification\n" . + "$prg: adjusting --verify-repo=$opts{'verify-repo'}\n"); + } delete $opts{"require-verification"}; delete $opts{"verify-downloads"}; - # - # check for correctness of verify-repo argument - if (defined($opts{"verify-repo"}) && - ($opts{"verify-repo"} !~ m/^(none|main|all)$/)) { - tldie("Unknown value for --verify-repo; $opts{verify-repo}\n"); - } # now $action should be part of %actionoptions, otherwise this is # an error @@ -6989,7 +6994,6 @@ sub load_config_file { # first set default values $config{"gui-expertmode"} = 1; $config{"auto-remove"} = 1; - $config{"require-verification"} = 0; $config{"persistent-downloads"} = 1; $config{"verify-repo"} = "main"; # do NOT set this here, we distinguish between explicitly set in the config file @@ -7087,7 +7091,7 @@ sub load_options_from_config { } } elsif ($key eq "verify-repo") { - if ($val =~ m/^(none|main|all)$/) { + if ($val =~ m/$allowed_verify_args_regex/) { $config{"verify-repo"} = $val; } else { tlwarn("$prg: $fn: Unknown value for verify-repo: $val\n"); @@ -7150,9 +7154,12 @@ sub convert_crypto_options { if ((defined($verify_downloads) || defined($require_verification)) && defined($verify_repo)) { # we cannot have all three, warn and bail out - tldie("The options verify-downloads and require-verification have been\n" . - "superseeded by verify-repo, please use only the later on!\n"); + tldie("$prg: The options verify-downloads and require-verification have been\n" . + "$prg: superseeded by verify-repo, please use only the later on!\n"); } + # return immediately if verify_repo is already set + return($verify_repo) if (defined($verify_repo)); + if (defined($verify_downloads)) { if ($verify_downloads) { # explicit --verify-downloads was given |