diff options
-rwxr-xr-x | Master/install-tl | 16 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 6 | ||||
-rw-r--r-- | Master/tlpkg/installer/install-menu-perltk.pl | 24 | ||||
-rwxr-xr-x | Master/tlpkg/installer/install-menu-text.pl | 8 | ||||
-rw-r--r-- | Master/tlpkg/installer/install-menu-wizard.pl | 16 |
5 files changed, 51 insertions, 19 deletions
diff --git a/Master/install-tl b/Master/install-tl index 6b365a32d96..2615b1c084e 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -493,7 +493,9 @@ if ($opt_profile eq "") { exit(3); } } else { - do_remote_init(); + if (!do_remote_init()) { + die ("Exiting installation.\n"); + } read_profile($opt_profile); } @@ -569,12 +571,15 @@ sub only_load_remote { $media = 'NET'; } } - load_tlpdb(); + return load_tlpdb(); } sub do_remote_init { - only_load_remote(@_); + if (!only_load_remote(@_)) { + tlwarn("$0: Could not load TeX Live Database from $location, goodbye.\n"); + return 0; + } if (!do_version_agree()) { TeXLive::TLUtils::tldie <<END_MISMATCH; $0: The TeX Live versions of the local installation @@ -585,6 +590,7 @@ Perhaps you need to use a different CTAN mirror? END_MISMATCH } final_remote_init(); + return 1; } sub do_version_agree { @@ -1358,7 +1364,8 @@ END_EXPLICIT_MIRROR $do_die = 0; } } - die "$0: Could not load TeX Live Database from $master, goodbye.\n" + #die "$0: Could not load TeX Live Database from $master, goodbye.\n" + return 0 if $do_die; } # set the defaults to what is specified in the tlpdb @@ -1396,6 +1403,7 @@ END_EXPLICIT_MIRROR $default_scheme = "scheme-minimal"; $vars{'selected_scheme'} = $default_scheme; } + return 1; } sub initialize_collections { diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 5e9e631998c..2af7b8d65fb 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -3501,7 +3501,9 @@ sub create_mirror_list { for my $mirror (@mirrors) { my $mfull = $mirror; $mfull =~ s!/$!!; - $mfull .= "/" . $TeXLive::TLConfig::TeXLiveServerPath; + # do not append the server path part here, but add + # it down there in the extract mirror entry + #$mfull .= "/" . $TeXLive::TLConfig::TeXLiveServerPath; #if ($first) { my $country_str = sprintf "%-12s", $country; push @ret, " $country_str $mfull"; @@ -3520,7 +3522,7 @@ sub create_mirror_list { sub extract_mirror_entry { my $ent = shift; my @foo = split ' ', $ent; - return $foo[$#foo]; + return $foo[$#foo] . "/" . $TeXLive::TLConfig::TeXLiveServerPath; } sub tlmd5 { diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index 441e34f31c7..b829c81b88e 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -85,6 +85,7 @@ my $pathbutton; my $deskintbutton; my $assocbutton; my $adminbutton; +my $installbutton; my $collectionstext; my $texmflocaltext; my $texmfsysvartext; @@ -182,6 +183,7 @@ sub enable_buttons { sub change_button_state { my $what = shift; + $installbutton->configure(-state => $what); $tmflocalbutton->configure(-state => $what); $tmfsysvarbutton->configure(-state => $what); $tmfsysconfigbutton->configure(-state => $what); @@ -245,7 +247,7 @@ sub run_menu_perltk { for my $l (@media_available) { my ($a, $b) = split ('#', $l); if ($a eq 'local_compressed' || $a eq 'local_uncompressed') { - push @loclst, " $b"; + push @loclst, " $b"; } elsif ($a eq 'NET') { push @netlst, " " . __("Command line repository") . ": $b"; } else { @@ -273,8 +275,11 @@ sub run_menu_perltk { sub { if ($mirror_entry !~ m/^ /) { $mirror_entry = ""; - } else { + } elsif ($mirror_entry =~ m!(http|ftp)://!) { $mirror_entry = TeXLive::TLUtils::extract_mirror_entry($mirror_entry); + } else { + $mirror_entry =~ s/^\s*//; + # $mirror_entry = TeXLive::TLUtils::extract_mirror_entry($mirror_entry); } }, -variable => \$mirror_entry)->grid(-row => $row, -column => 2, -sticky => 'w'); @@ -283,7 +288,14 @@ sub run_menu_perltk { $::init_remote_needed = 1; my $mfull = $mirror_entry; only_load_remote($mfull); - if (!do_version_agree()) { + if (!only_load_remote($mfull)) { + $fr->Dialog(-title => __("Warning"), + -text => __('Could not load remote TeX Live Database:') . $mfull + . "\n\n" . + __('Please select a different mirror.'), + -buttons => [ __("Ok") ])->Show; + $mirror_entry = ""; + } elsif (!do_version_agree()) { $fr->Dialog(-title => __("Warning"), -text => __('The TeX Live versions of the local installation and the repository being accessed are not compatible: local: %s @@ -483,10 +495,10 @@ Please select a different mirror.', $TeXLive::TLConfig::ReleaseYear, $texlive_re # install/cancel buttons my $f3 = $fr->Frame; - $f3->Button( + $installbutton = $f3->Button( -text => __("Install TeX Live"), - -command => sub { installation_window(); } - )->pack(-side => 'left', -padx => "2m", -pady => "2m")->focus(); + -command => sub { installation_window(); }); + $installbutton->pack(-side => 'left', -padx => "2m", -pady => "2m")->focus(); my $quitbutton = $f3->Button( -text => __("Quit"), -command => \&menu_abort, diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl index 082b3519a69..4a4f64dab42 100755 --- a/Master/tlpkg/installer/install-menu-text.pl +++ b/Master/tlpkg/installer/install-menu-text.pl @@ -134,7 +134,7 @@ sub run_menu_text { } } print "----\n"; - print "[0] default mirror - http://mirror.ctan.org\n"; + print "[0] default mirror http://mirror.ctan.org\n"; my $local_ind = "a"; if ($#media_available >= 0) { print "Local repositories:\n"; @@ -214,7 +214,11 @@ sub run_menu_text { } } # run remote init - do_remote_init($::init_remote_needed); + if (!do_remote_init($::init_remote_needed)) { + print "Please select a different mirror! Press Enter to continue."; + $ans = readline(*STDIN); + run_menu_text(@args); + } # the text mode installer does not take interest in any argument # but the -old-installation-found while (@args) { diff --git a/Master/tlpkg/installer/install-menu-wizard.pl b/Master/tlpkg/installer/install-menu-wizard.pl index 6109ed27fa1..737d2cee972 100644 --- a/Master/tlpkg/installer/install-menu-wizard.pl +++ b/Master/tlpkg/installer/install-menu-wizard.pl @@ -233,7 +233,7 @@ sub ask_mirror { for my $l (@media_available) { my ($a, $b) = split ('#', $l); if ($a eq 'local_compressed' || $a eq 'local_uncompressed') { - push @loclst, " $b"; + push @loclst, " $b"; } elsif ($a eq 'NET') { #push @netlst, " cmd line repository: $b"; push @netlst, " " . __("Command line repository") . ": $b"; @@ -258,7 +258,7 @@ sub ask_mirror { $fmain->Label(-text => __("Mirror:"))->place(-x => 0, -y => 50); $fmain->BrowseEntry(-state => 'readonly', -listheight => 12, - -listwidth => 600, + -listwidth => 400, -width => 35, -autolistwidth => 1, -choices => \@mirror_list, @@ -266,8 +266,11 @@ sub ask_mirror { sub { if ($mirror_entry !~ m/^ /) { $mirror_entry = ""; - } else { + } elsif ($mirror_entry =~ m!(http|ftp)://!) { $mirror_entry = TeXLive::TLUtils::extract_mirror_entry($mirror_entry); + } else { + $mirror_entry =~ s/^\s*//; + # $mirror_entry = TeXLive::TLUtils::extract_mirror_entry($mirror_entry); } }, -variable => \$mirror_entry)->place(-x => 150, -y => 50); @@ -388,8 +391,11 @@ sub load_remote_screen { $nxt->configure(-text => __('Cancel'), -command => sub { $return = $MENU_ABORT; $mw->destroy; }); $mw->update; - only_load_remote($remote_path); - if (!do_version_agree()) { + if (!only_load_remote($remote_path)) { + $labela->configure(-text => __('Could not load remote TeX Live Database:') . $remote_path); + $labelb->configure(-text => __('Please go back and select a different mirror.')); + $prv->configure(-text => __('< Back'), -command => \&reset_start ); + } elsif (!do_version_agree()) { $labela->configure(-text => __('The TeX Live versions of the local installation and the repository being accessed are not compatible: local: %s |