diff options
author | Norbert Preining <preining@logic.at> | 2010-05-23 14:51:05 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2010-05-23 14:51:05 +0000 |
commit | 01b299aa854d009a20e4fe28f5d21d878ee179cb (patch) | |
tree | 9ad8a7f6ba092767e521002f21895e6277b7c638 /Master/texmf | |
parent | a2c049ad8325926e919ef9f2e1eca270288ad843 (diff) |
by default allow only ftp mirrors, and try mirror.ctan.org 5 times
for a proper mirror. If then there is still no success, fall back to
one of the backbone nodes.
Add support for command line option -allow-ftp in install-tl and tlmgr
all support for setting allow-ftp = 1 permanently in tlmgr config file
git-svn-id: svn://tug.org/texlive/trunk@18431 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 4765b15d77e..4f1b91fdaa6 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -95,6 +95,7 @@ our $tlmediatlpdb; our $location; # location from which the new packages come our $localtlmedia; # local installation which we are munging our $localtlpdb; # local installation which we are munging +our @allow_ftp_args; # flags for machine-readable form our $FLAG_REMOVE = "d"; @@ -126,6 +127,7 @@ sub main { "machine-readable" => 1, "package-logfile" => "=s", "persistent-downloads" => "!", + "allow-ftp" => "!", "pause" => 1, "version" => 1, "help|h|?" => 1); @@ -353,6 +355,26 @@ sub main { if $do_persistent; } + # + # check for allowing ftp connections in the tlmgr config file and + # command line + { + my $do_ftp; + if (defined($opts{'allow-ftp'})) { + $do_ftp = ($opts{'allow-ftp'} ? 1 : 0); + } else { + if (defined($config{'allow-ftp'})) { + $do_ftp = $config{'allow-ftp'}; + } + } + # default is not to allow ftp mirrors + if (!defined($do_ftp)) { + $do_ftp = 0; + } + debug("are ftp mirrors are allowed: $do_ftp\n"); + push @allow_ftp_args, '-allow-ftp', $do_ftp; + } + execute_action($action, @ARGV); # end of main program. @@ -440,7 +462,7 @@ sub execute_action { } finish(0); } elsif ($action =~ m/^get-mirror$/i) { - my $loc = give_ctan_mirror(); + my $loc = give_ctan_mirror(@allow_ftp_args); print "$loc\n"; finish(0); } elsif ($action =~ m/^generate$/i) { @@ -4174,9 +4196,9 @@ sub init_tlmedia # choose a mirror if we are asked. if ($location =~ m/^ctan$/i) { - $location = give_ctan_mirror(); + $location = give_ctan_mirror(@allow_ftp_args); } elsif ($location =~ m,^$TeXLiveServerURL,) { - my $mirrorbase = TeXLive::TLUtils::give_ctan_mirror_base(); + my $mirrorbase = TeXLive::TLUtils::give_ctan_mirror_base(@allow_ftp_args); $location =~ s,^$TeXLiveServerURL,$mirrorbase,; } @@ -4392,7 +4414,13 @@ sub load_config_file if (($val eq "0") || ($val eq "1")) { $config{'persistent-downloads'} = $val; } else { - tlwarn("Unknown value $val for persistent_download in $fn\n"); + tlwarn("Unknown value $val for persistent-downloads in $fn\n"); + } + } elsif ($key eq "allow-ftp") { + if (($val eq "0") || ($val eq "1")) { + $config{'allow-ftp'} = $val; + } else { + tlwarn("Unknown value $val for allow-ftp in $fn\n"); } } else { tlwarn("Unknown key $key in $fn\n"); @@ -4708,6 +4736,16 @@ fall back to using wget if this is not possible. If you want to disable usage of LWP and persistent connections, please use B<--no-persistent-downloads>. +=item B<-allow-ftp> + +By default if mirror.ctan.org is contacted only http mirrors are accepted. +Adding this command line switch allows ftp mirrors of the CTAN nodes. + +If you set a ftp mirror explicitely, that one is in any case used. + +You can permanently turn this option on in the tlmgr config file, see +L<CONFIGURATION FILE> below for details. + =item B<--debug-translation> In GUI mode, this switch makes C<tlmgr> report any missing, or more |