From 03fe8266f35acb30b86416f4c561943d568448f9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 17 Sep 2011 07:40:33 +0000 Subject: installer and mirror selection - don't show the terminal /systems/texlive/tlnet - allow for reselection in case of load failure git-svn-id: svn://tug.org/texlive/trunk@23990 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl | 16 ++++++++++++---- Master/tlpkg/TeXLive/TLUtils.pm | 6 ++++-- Master/tlpkg/installer/install-menu-perltk.pl | 24 ++++++++++++++++++------ Master/tlpkg/installer/install-menu-text.pl | 8 ++++++-- Master/tlpkg/installer/install-menu-wizard.pl | 16 +++++++++++----- 5 files changed, 51 insertions(+), 19 deletions(-) (limited to 'Master') 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 <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 -- cgit v1.2.3