texlive[50257] Master: Tcl now default gui

commits+siepo at tug.org commits+siepo at tug.org
Wed Mar 6 12:15:49 CET 2019


Revision: 50257
          http://tug.org/svn/texlive?view=revision&revision=50257
Author:   siepo
Date:     2019-03-06 12:15:49 +0100 (Wed, 06 Mar 2019)
Log Message:
-----------
Tcl now default gui

Modified Paths:
--------------
    trunk/Master/install-tl
    trunk/Master/install-tl-windows.bat
    trunk/Master/tlpkg/installer/install-tl-gui.tcl

Modified: trunk/Master/install-tl
===================================================================
--- trunk/Master/install-tl	2019-03-06 10:36:56 UTC (rev 50256)
+++ trunk/Master/install-tl	2019-03-06 11:15:49 UTC (rev 50257)
@@ -41,60 +41,69 @@
   unshift (@INC, "$::installerdir/tlpkg");
 }
 
-# Unix-only: want tcl GUI?
-# If so, this run of install-tl does duty as a wrapper for install-tl-gui.tcl,
-# which in its turn will start an actual run of install-tl.
-# On windows an external batch wrapper replaces the built-in wrapper below.
+# On unix, this run of install-tl may do duty as a wrapper for
+# install-tl-gui.tcl, which in its turn will start an actual run of install-tl.
+# Skip this wrapper block if we can easily rule out a tcl gui:
 
-if ($^O !~ /^MSWin/i) {
+if (($^O !~ /^MSWin/i) &&
+      # this wrapper is only for unix, since windows has its own wrapper
+      ($#ARGV >= 0 || ($^O eq 'darwin')) &&
+      # tcl parameter may still come, or tcl is default
+      ($#ARGV < 0 || $ARGV[0] ne '-from_ext_gui')
+      # this run is not invoked by tcl
+    ) {
+  my $want_tcl = ($^O eq 'darwin');
   my $i=-1;
   my @new_args = ();
-  my $want_tcl = 0;
   while ($i<$#ARGV) {
-    # build argument array for install-tl-gui.tcl.
-    # But once we know that install-tl-gui.tcl is not going to be invoked,
-    # we quit scanning and continue with the original @ARGV
-    $i++;
-    my $p = $ARGV[$i];
-    if ($p eq 'from_ext_gui') {
-      $want_tcl = 0;
-      last;
-    } elsif ($p =~ /^-?-gui=(.*$)/) {
+    # build argument array @new_args for install-tl-gui.tcl.
+    # quit scanning and building @new_args once tcl is ruled out.
+    my $p = $ARGV[++$i];
+    if ($p =~ /^-?-gui=(.*$)/) {
       if ($1 eq 'tcl') {
         $want_tcl = 1;
       } else {
-        last; # other gui: can forget about @new_args
+        last; # other gui
       }
     } elsif ($p =~ /^-?-gui/) {
+      # look ahead at next parameter
       if ($i == $#ARGV) {
-        last; # default gui => not tcl
+        $want_tcl = 1; # default gui
+        last;
       } elsif ($ARGV[$i+1] eq 'tcl') {
         $i++;
         $want_tcl = 1;
+      } elsif ($ARGV[$i+1] eq 'expert' || $ARGV[$i+1] eq 'perltk' ||
+                 $ARGV[$i+1] eq 'wizard' || $ARGV[$i+1] eq 'text') {
+        $want_tcl = 0;
+        last;
       } else {
-        last;
+        # next parameter relates to something else, so default gui is wanted
+        $want_tcl = 1;
       }
+    } elsif ($p =~ /^-?-no-gui/) {
+      $want_tcl = 0;
+      last;
     } else {
       # not gui-related, continue collecting @new_args
       push (@new_args, $p);
     }
   }
+  # done scanning arguments
   if ($want_tcl) {
     unshift (@new_args, "--");
     unshift (@new_args, "$::installerdir/tlpkg/installer/install-tl-gui.tcl");
-    if (!(defined $ENV{'WISH'}) || !exec($ENV{'WISH'}, @new_args)) {
-      if (!exec('wish', @new_args)) {
-        if (!exec('wish8.6', @new_args)) {
-          if (!exec('wish8.5', @new_args)) {
-            if (!exec('tclkit', @new_args)) {
-              die "wish not found\n";
-            }
-          }
-        }
+    my @wishes = qw /wish wish8.6 wish8.5 tclkit/;
+    unshift @wishes, $ENV{'WISH'} if (defined $ENV{'WISH'});
+    foreach my $w (@wishes) {
+      if (!exec($w, @new_args)) {
+        next; # no return on successful exec
       }
     }
-  }
+    # no succesful exec of wish
+  } # else continue with main installer below
 }
+# end of wrapper block, start of the real installer
 
 use Cwd 'abs_path';
 use Getopt::Long qw(:config no_autoabbrev);
@@ -231,7 +240,8 @@
 my $opt_allow_ftp = 0;
 my $opt_custom_bin;
 my $opt_force_arch;
-my $opt_gui = (win32() ? "wizard" : "text");
+# tcl gui weeded out at start
+my $opt_gui = "text";
 my $opt_help = 0;
 my $opt_init_from_profile = "";
 my $opt_location = "";
@@ -340,12 +350,13 @@
            "warn-checksums!"             => \$opt_warn_checksums,
            "help|?"                      => \$opt_help) or pod2usage(2);
 
-if ($opt_gui eq "") {
-  # the --gui option was given with an empty argument, set it to perltk
+if ($opt_gui eq "expert") {
   $opt_gui = "perltk";
 }
-if ($opt_gui eq "expert") {
+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";

Modified: trunk/Master/install-tl-windows.bat
===================================================================
--- trunk/Master/install-tl-windows.bat	2019-03-06 10:36:56 UTC (rev 50256)
+++ trunk/Master/install-tl-windows.bat	2019-03-06 11:15:49 UTC (rev 50257)
@@ -30,7 +30,7 @@
 set instroot=%~dp0
 
 set notcl=no
-set tcl=no
+set tcl=yes
 set args=
 goto rebuildargs
 
@@ -38,12 +38,13 @@
 rem handle -gui tcl here and do not pass it on to perl or tcl.
 rem cmd.exe converts '=' to a space:
 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
 :dogui
 if x == x%1 (
-set tcl=no
-set args=%args% -gui wizard
+set tcl=yes
 shift
 goto rebuildargs
 )
@@ -52,30 +53,27 @@
 set args=%args% -no-gui
 shift
 goto rebuildargs
-)
-if wizard == %1 (
-set tcl=no
-set args=%args% -gui wizard
+) else if wizard == %1 (
+set tcl=yes
 shift
 goto rebuildargs
-)
-if perltk == %1 (
-set tcl=no
-set args=%args% -gui perltk
+) else if perltk == %1 (
+set tcl=yes
 shift
 goto rebuildargs
-)
-if expert == %1 (
-set tcl=no
-set args=%args% -gui perltk
+) else if expert == %1 (
+set tcl=yes
 shift
 goto rebuildargs
-)
-if tcl == %1 (
+) else if tcl == %1 (
 set tcl=yes
 shift
 goto rebuildargs
+) else (
+set tcl=yes
+goto rebuildargs
 )
+rem last case: -gui without parameter, do not shift
 
 rem loop for argument scanning
 :rebuildargs
@@ -95,6 +93,7 @@
 if -version == %p% set tcl=no
 if -no-gui == %p% (
 set notcl=yes
+set args=%args% -no-gui
 goto rebuildargs
 )
 if -gui == %p% goto dogui
@@ -131,7 +130,6 @@
 rem Use TL Perl
 path=%instroot%tlpkg\tlperl\bin;%path%
 set PERL5LIB=%instroot%tlpkg\tlperl\lib
-rem for now, assume tcl/tk is on path
 
 rem Clean environment from other Perl variables
 set PERL5OPT=

Modified: trunk/Master/tlpkg/installer/install-tl-gui.tcl
===================================================================
--- trunk/Master/tlpkg/installer/install-tl-gui.tcl	2019-03-06 10:36:56 UTC (rev 50256)
+++ trunk/Master/tlpkg/installer/install-tl-gui.tcl	2019-03-06 11:15:49 UTC (rev 50257)
@@ -133,7 +133,7 @@
   .log.tx insert end [__ "Welcome to TeX Live!"] center
   .log.tx insert end "\n\n"
   # tags appear to interfere with --/::msgcat::mc !?!
-  set s  [__ "See %s/index.html for links to documentation.\nThe TeX Live web site (http://tug.org/texlive/) contains any updates and corrections. TeX Live is a joint project of the TeX user groups around the world; please consider supporting it by joining the group best for you. The list of groups is available on the web at http://tug.org/usergroups.html." $::vars(TEXDIR)]
+  set s  [__ "See %s/index.html for links to documentation.\nThe TeX Live web site (https://tug.org/texlive/) contains any updates and corrections. TeX Live is a joint project of the TeX user groups around the world; please consider supporting it by joining the group best for you. The list of groups is available on the web at https://tug.org/usergroups.html." $::vars(TEXDIR)]
   .log.tx insert end $s center
   if {$::tcl_platform(platform) ne "windows"} {
     .log.tx insert end "\n\n"
@@ -1220,7 +1220,7 @@
 
     incr rw
     if {!$::alltrees} {
-      ttk::button .tmoreb -text [__ "More..."] -command {
+      ttk::button .tmoreb -text [__ "More ..."] -command {
         set ::menu_ans "alltrees"
         if [info exists ::env(dbgui)] {puts "dbgui: requested alltrees"}
       }
@@ -1673,6 +1673,7 @@
     incr i
   }
   unset i
+  # tk_messageBox -message [join $cmd " "] -title "debugging"
   show_time "opening pipe"
   if [catch {open "|[join $cmd " "] 2>@1" r+} ::inst] {
     # "2>@1" ok under Windows >= XP



More information about the tex-live-commits mailing list