From 6d3366b64e9cc2a4f62ec81acdf57ec4b2dacb15 Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Sun, 31 May 2020 20:09:55 +0000 Subject: Perl/Tk installers removed git-svn-id: svn://tug.org/texlive/trunk@55357 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl | 146 +++++++----------------------- Master/install-tl-windows.bat | 31 ++++--- Master/tlpkg/installer/install-tl-gui.tcl | 62 ++++--------- Master/tlpkg/tltcl/tltcl.tcl | 1 - 4 files changed, 71 insertions(+), 169 deletions(-) (limited to 'Master') diff --git a/Master/install-tl b/Master/install-tl index 026945d2743..6ae8b239751 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -76,6 +76,7 @@ if (($^O !~ /^MSWin/i) && # quit scanning and building @new_args once tcl is ruled out. my $want_tcl = ($^O eq 'darwin'); my $asked4tcl = 0; + my $forbid = 0; my @new_args = (); $i = -1; while ($i < $#tmp_args) { @@ -83,28 +84,29 @@ if (($^O !~ /^MSWin/i) && if ($p eq '-gui') { # look ahead at next parameter if ($i == $#tmp_args || $tmp_args[$i+1] =~ /^-/) { - $want_tcl = 1; # default value for -gui - $asked4tcl = 1; - } elsif ($tmp_args[$i+1] eq 'tcl') { + # just -gui, without value $want_tcl = 1; $asked4tcl = 1; - $i++; - } else { # other value for -gui + } elsif ($tmp_args[$i+1] eq 'text') { $want_tcl = 0; + $forbid = 1; last; - } - } else { - my $forbid = 0; - for my $q (qw/in-place profile help/) { - if ($p eq "-$q") { - # default text mode - $want_tcl = 0 unless $asked4tcl; - last; + } else { + # check all allowed values for -gui + my $q = $tmp_args[$i+1]; + if ($q eq 'tcl' || $q eq 'perltk' || + $q eq 'wizard' || $q eq 'expert') { + $want_tcl = 1; + $asked4tcl = 1; + $i++; + } else { + die "$0: illegal value $q for parameter -gui.\n"; } } - for my $q (qw/print-platform version no-gui/) { + } else { + for my $q (qw/in-place profile help print-platform version no-gui/) { if ($p eq "-$q") { - # enforce text mode + # ignore gui mode $want_tcl = 0; $forbid = 1; last; @@ -119,7 +121,7 @@ if (($^O !~ /^MSWin/i) && if ($want_tcl) { unshift (@new_args, "--"); unshift (@new_args, "$::installerdir/tlpkg/installer/install-tl-gui.tcl"); - my @wishes = qw /wish wish8.6 wish8.5 tclkit/; + my @wishes = qw /wish wish8.7 wish8.6 wish8.5 tclkit/; unshift @wishes, $ENV{'WISH'} if (defined $ENV{'WISH'}); foreach my $w (@wishes) { if (!exec($w, @new_args)) { @@ -365,15 +367,6 @@ GetOptions( "version" => \$opt_version, "warn-checksums!" => \$opt_warn_checksums, "help|?" => \$opt_help) or pod2usage(2); - -if ($opt_gui eq "expert") { - $opt_gui = "perltk"; -} -if ($opt_gui eq "" || $opt_gui eq "tcl") { - # tried and failed tcl, try perltk instead - $opt_gui = "perltk"; - warn "Setting opt_gui to perltk instead"; -} if ($from_ext_gui) { $opt_gui = "extl"; } @@ -438,12 +431,7 @@ die "$0: Options init-from-profile and in-place are incompatible.\n" if ($opt_in_place && $opt_init_from_profile); if ($#ARGV >= 0) { - # we still have arguments left, should only be gui, otherwise die - if ($ARGV[0] =~ m/^gui$/i) { - $opt_gui = "perltk"; - } else { - die "$0: Extra arguments `@ARGV'; try --help if you need it.\n"; - } + die "$0: Extra arguments `@ARGV'; try --help if you need it.\n"; } @@ -451,7 +439,7 @@ if (defined($::opt_lang)) { $::lang = $::opt_lang; } -if ($opt_profile) { # for now, not allowed if in_place +if ($opt_profile) { # not allowed if in_place if (-r $opt_profile && -f $opt_profile) { info("Automated TeX Live installation using profile: $opt_profile\n"); } else { @@ -519,47 +507,6 @@ END_NO_CHECKSUMS # continuing with normal install -# check as soon as possible for GUI functionality to give people a chance -# to interrupt. -# not needed for extl, because in this case install-tl is invoked by external gui -if (($opt_gui ne "extl") && ($opt_gui ne "text") && !$opt_no_gui && ($opt_profile eq "")) { - # try to load Tk.pm, but don't die if it doesn't work - eval { require Tk; }; - if ($@) { - # that didn't work out, so warn the user and continue with text mode - tlwarn("Cannot load Tk, maybe something is missing and\n"); - tlwarn("maybe https://tug.org/texlive/distro.html#perltk can help.\n"); - tlwarn("Error message from loading Tk:\n"); - tlwarn(" $@\n"); - tlwarn("Continuing in text mode...\n"); - $opt_gui = "text"; - } - eval { my $foo = Tk::MainWindow->new; $foo->destroy; }; - if ($@) { - tlwarn("perl/Tk unusable, cannot create main window.\n"); - if (platform() eq "universal-darwin") { - tlwarn("That could be because X11 is not installed or started.\n"); - } - tlwarn("Error message from creating MainWindow:\n"); - tlwarn(" $@\n"); - tlwarn("Continuing in text mode...\n"); - $opt_gui = "text"; - } else { - # try to set up fonts if $opt_gui is given - if ($opt_font) { - my @a; - push @a, "--font", $opt_font; - Tk::CmdLine::SetArguments(@a); - } - } - if ($opt_gui eq "text") { - # we switched from GUI to non-GUI mode, tell the user and wait a bit - tlwarn("\nSwitching to text mode installer, if you want to cancel, do it now.\n"); - tlwarn("Waiting for 3 seconds\n"); - sleep(3); - } -} - if (defined($opt_force_arch)) { tlwarn("Overriding platform to $opt_force_arch\n"); $::_platform_ = $opt_force_arch; @@ -705,9 +652,6 @@ if ($opt_profile eq "") { die ("Exiting installation.\n"); } read_profile($opt_profile); - if ($from_ext_gui) { - print STDOUT "startinst\n"; - } } my $varsdump = ""; @@ -2764,38 +2708,19 @@ following modules are supported: The text mode user interface (default on Unix systems). Same as the C<-no-gui> option. -=item C +=item C (or "perltk" or "wizard" or "expert" or nothing) The Tcl/Tk user interface (default on Macs and Windows). It starts with a small number of configuration options, roughly equivalent -to what the wizard option below offers, but a button C -takes you to a screen with roughly the same options as the C -interface. - -=item C - -The wizard mode user interface, asking only minimal questions before -installing all of TeX Live. - -=item C - -A generic name for, currently, C; it may select a different GUI -in the future. - -=item C - -The expert GUI installer, providing access to more options. +to what the former wizard option offers, but a button C +takes you to a screen with roughly the same options as the former +C interface. =back -The C and C modules require the Perl/Tk module -(L). if Perl/Tk is not -available, installation continues in text mode, except on Windows, -where all gui options except C are diverted to the default -C GUI. - -The C GUI requires Tcl/Tk. This is standard on Macs and is often -already installed on GNU/Linux. For Windows, TeX Live provides a Tcl/Tk +The default GUI requires Tcl/Tk. This is standard on Macs (although +it is considered deprecated since Catalina) and is often already +installed on GNU/Linux. For Windows, TeX Live provides a Tcl/Tk runtime. =item B<-no-gui> @@ -2806,10 +2731,8 @@ Use the text mode installer (default except on Windows and Macs). =item B<-lang> I -By default, the GUI tries to deduce your language from the -environment. The Tcl GUI uses the language detection built into -Tcl/Tk; the Perl/Tk GUIs use the C environment -variable. If that fails you can select a different language by +By default, the Tcl GUI uses the language detection built into +Tcl/Tk. If that fails you can select a different language by giving this option with a language code (based on ISO 639-1). Currently supported (but not necessarily completely translated) are: English (en, default), Czech (cs), German (de), French (fr), Italian @@ -2839,8 +2762,8 @@ will be adjusted accordingly. =item B<-select-repository> This option allows you to choose a particular mirror from the current -list of active CTAN mirrors. This option is supported in the C, -C and C installer modes, and will also offer to install +list of active CTAN mirrors. This option is supported in the C +and C installer modes, and will also offer to install from local media if available, or from a repository specified on the command line. It's useful when the (default) automatic redirection does not choose a good host for you. @@ -2870,9 +2793,10 @@ building TeX Live, see L. =item B<-debug-translation> -In the Perl/Tk GUI modes, this option reports any missing, or more -likely untranslated, messages to standard error. Helpful for -translators to see what remains to be done. +In the former Perl/Tk GUI modes, this option reported any missing, +or more likely untranslated, messages to standard error. Not yet +implemented for the Tcl interface. Helpful for translators to see +what remains to be done. =item B<-force-platform> I diff --git a/Master/install-tl-windows.bat b/Master/install-tl-windows.bat index 1caf59962b1..2a9b23afdaf 100755 --- a/Master/install-tl-windows.bat +++ b/Master/install-tl-windows.bat @@ -16,11 +16,11 @@ if %ver_str:~,2% == 4. goto tooold if %ver_str:~,2% == 5. goto tooold if %ver_str:~,3% == 6.0 ( echo WARNING: Windows 7 is the earliest supported version. - echo TeX Live 2018 has not been tested on Windows Vista. + echo TeX Live 2020 has not been tested on Windows Vista. pause ) -rem version of external perl, if any +rem version of external perl, if any. used by install-tl. set extperl=0 for /f "usebackq tokens=2 delims='" %%a in (`perl -V:version 2^>NUL`) do ( set extperl=%%a @@ -42,12 +42,18 @@ rem '-parameter=value' becomes '-parameter value': two arguments rem we test for value == parameter rather than the other way around rem to avoid some weird parsing errors -rem code block for gui argument +rem code block for gui argument: look at next argument :dogui if x == x%1 ( set tcl=yes set asked4gui=yes -shift +goto nomoreargs +) +set q=%1 +if "-" == "%q:~,1%" ( +rem %1 is no value for -gui but another parameter +set tcl=yes +set asked4gui=yes goto rebuildargs ) if text == %1 ( @@ -77,9 +83,9 @@ set asked4gui=yes shift goto rebuildargs ) else ( -set tcl=yes -set asked4gui=yes -goto rebuildargs +echo Illegal value %1 for -gui +set errlev=1 +goto eoff ) rem last case was -gui without parameter to shift @@ -101,9 +107,8 @@ if not "%q:~,2%" == "--" goto nominmin set p=%p:~1% :nominmin -rem countermand gui parameter for short output. -rem assume text mode for help and for profile install, -rem unless gui was explicitly requested. +rem countermand gui parameter for short output, help and profile install. +rem even if gui was explicitly requested. if -print-platform == %p% ( set tcl=no set forbid=yes @@ -117,14 +122,12 @@ set tcl=no set forbid=yes ) if -profile == %p% ( -if no == %asked4gui% ( set tcl=no -) +set forbid=yes ) if -help == %p% ( -if no == %asked4gui% ( set tcl=no -) +set forbid=yes ) if -gui == %p% goto dogui diff --git a/Master/tlpkg/installer/install-tl-gui.tcl b/Master/tlpkg/installer/install-tl-gui.tcl index 3f5a567c2bf..49d63fa6ff0 100755 --- a/Master/tlpkg/installer/install-tl-gui.tcl +++ b/Master/tlpkg/installer/install-tl-gui.tcl @@ -37,14 +37,15 @@ catch {rename send {}} # This file should be in $::instroot/tlpkg/installer. # On non-windows platforms, install-tl functions as a wrapper -# for this file if it encounters a parameter '-gui tcl'. +# for this file if it encounters a parameter '-gui' (but not -gui text). # This allows automatic inclusion of a '--' parameter to separate # tcl parameters from script parameters. set ::instroot [file normalize [info script]] set ::instroot [file dirname [file dirname [file dirname $::instroot]]] -# declarations, initializations and procs shared with tlshell.tcl +# declarations, initializations and procs shared with tlshell.tcl. +# tltcl may want to know whether or not it was invoked by tlshell: set ::invoker [file tail [info script]] if [string match -nocase ".tcl" [string range $::invoker end-3 end]] { set ::invoker [string range $::invoker 0 end-4] @@ -69,7 +70,7 @@ if {$::tcl_platform(platform) eq "windows"} { set ::advanced 0 set ::alltrees 0 -# interactively select repository +# interactively select repository; default false set ::select_repo 0 proc kill_perl {} { @@ -381,7 +382,7 @@ proc pre_splash {} { # wallpaper for remaining widgets pack [ttk::frame .bg -padding 3] -fill both -expand 1 - # buttons: abort button, mirrors dropdown menu + # frame for buttons (abort button, mirrors dropdown menu) pack [ttk::frame .splfb] -in .bg -side bottom -fill x } @@ -1331,10 +1332,6 @@ option add *Menu.tearOff 0 # of this array. # We still use blocking i/o: frontend and backend wait for each other. -# idea: follow submenu organization of text installer -# for 3-way options, create an extra level of children -# instead of wizard install, supppress some options - ## default_bg color, only used for menus under ::plain_unix if [catch {ttk::style lookup TFrame -background} ::default_bg] { set ::default_bg white @@ -1963,15 +1960,14 @@ proc run_installer {} { set ::out_log {} show_log 1; # 1: with abort button .close state disabled - if $::did_gui { - chan puts $::inst "startinst" - write_vars - } + chan puts $::inst "startinst" + write_vars # the backend was already running and needs no further encouragement # switch to non-blocking i/o chan configure $::inst -buffering line -blocking 0 chan event $::inst readable read_line_cb + raise . if {$::tcl_platform(platform) eq "windows"} {wm deiconify .} }; # run_installer @@ -1998,33 +1994,24 @@ proc main_prog {} { # handle some command-line arguments. # the argument list should already be normalized: '--' => '-', "=" => ' ' - set i 0 - set do_splash 1 set ::prelocation "..." set ::mir_selected 1 ; # i.e. default or set by parameter - set i [llength $::argv] + set l [llength $::argv] + set i $l while {$i > 0} { + set iplus $i incr i -1 set p [lindex $::argv $i] - if {$p eq "-profile"} { - # check for profile argument: no splash screen if present - set do_splash 0 - } elseif {$p in [list "-location" "-url" "-repository" "-repos" "-repo"]} { + if {$p in [list "-location" "-url" "-repository" "-repos" "-repo"]} { # check for repository argument: bail out if obviously invalid - set j [expr {$i+1}] - if {$j<[llength $::argv]} { - set p [lindex $::argv $j] - unset j + if {$iplus<$l} { + set p [lindex $::argv $iplus] if {$p ne "ctan" && ! [possible_repository $p]} { - tk_messageBox -message [__ "%s not a local or remote repository" $p] \ - -title [__ "Error"] -type ok -icon error - exit + err_exit [__ "%s not a local or remote repository" $p] } set ::prelocation $p } else { - tk_messageBox -message [__ "%s requires an argument" $p] \ - -title [__ "Error"] -type ok -icon error - exit + err_exit [__ "%s requires an argument" $p] } } elseif {$p eq "-select-repository"} { # in this case, we start with selecting a repository @@ -2037,23 +2024,15 @@ proc main_prog {} { } unset i - if {$do_splash || ! [info exists ::mir_selected]} pre_splash - if {! [info exists ::mir_selected]} { + pre_splash select_mirror } - if $do_splash make_splash - unset do_splash - - if {! [info exist ::mir_selected]} { - vwait ::mir_selected - } - # start install-tl-[tcl] via a pipe. set cmd [list "|${::perlbin}" "${::instroot}/install-tl" \ "-from_ext_gui" {*}$::argv 2>@1] - show_time "opening pipe" + #show_time "opening pipe" if [catch {open $cmd r+} ::inst] { err_exit "Error starting Perl backend" } @@ -2069,8 +2048,7 @@ proc main_prog {} { # possible input from perl until the menu starts: # - question about prior canceled installation # - location (actual repository) - # - menu data, help, version, print-platform - set ::did_gui 0 + # - menu data set answer "" unset -nocomplain ::loaded while 1 { ; # initial perl output @@ -2102,7 +2080,6 @@ If this takes too long, press Abort or choose another repository." \ # waiting till the repository has been loaded vwait ::loaded unset ::loaded - #puts stderr "done loading" # resume reading from back end in blocking mode while 1 { set ll [read_line] @@ -2130,7 +2107,6 @@ If this takes too long, press Abort or choose another repository." \ set answer [run_menu] } } - set ::did_gui 1 break } elseif {$l eq "startinst"} { # use an existing profile: diff --git a/Master/tlpkg/tltcl/tltcl.tcl b/Master/tlpkg/tltcl/tltcl.tcl index 7af693b5649..ff5c273c053 100644 --- a/Master/tlpkg/tltcl/tltcl.tcl +++ b/Master/tlpkg/tltcl/tltcl.tcl @@ -339,7 +339,6 @@ proc load_translations {} { } } } -initialize_language load_translations proc __ {s args} { -- cgit v1.2.3