diff options
Diffstat (limited to 'Master')
-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 |