texlive[50554] Master/texmf-dist/scripts/tlshell/tlshell.tcl: Show

commits+siepo at tug.org commits+siepo at tug.org
Sat Mar 23 22:03:32 CET 2019


Revision: 50554
          http://tug.org/svn/texlive?view=revision&revision=50554
Author:   siepo
Date:     2019-03-23 22:03:32 +0100 (Sat, 23 Mar 2019)
Log Message:
-----------
Show svn revision tlshell and tlmgr; path under w32; 'update tlmgr' button commented out

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl

Modified: trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl
===================================================================
--- trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl	2019-03-23 20:52:56 UTC (rev 50553)
+++ trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl	2019-03-23 21:03:32 UTC (rev 50554)
@@ -10,7 +10,8 @@
 # security: disable send
 catch {rename send {}}
 
-# make sure TL comes first on process searchpath
+# unix: make sure TL comes first on process searchpath
+# on windows, runscript takes care of this.
 if {$::tcl_platform(platform) ne "windows"} {
   set texbin [file dirname [file normalize [info script]]]
   set savedir [pwd]
@@ -26,6 +27,18 @@
   unset texbin
   unset savedir
   unset dirs
+} else {
+  # until we have a better wrapper, just hardcode stuff
+  set texbin [file dirname [file normalize [info script]]]
+  set texbin "$texbin\\..\\..\\..\\bin\\win32"
+  set texbin [file normalize $texbin]
+  set texbin [string map {/ \\} $texbin]
+  set dirs [split $::env(PATH) ";"]
+  if {[lindex $dirs 0] ne $texbin} {
+    set ::env(PATH) "${texbin};$::env(PATH)"
+  }
+  unset texbin
+  unset dirs
 }
 
 # declarations and utilities shared with install-tl-gui.tcl
@@ -354,9 +367,13 @@
 } ; # start_tlmgr
 
 proc close_tlmgr {} {
-  catch {chan close $::tlshl}
-  catch {chan close $::err}
-  set ::perlpid 0
+  if {[catch {chan close $::tlshl}] || [catch {chan close $::err}]} {
+    tk_messageBox -message [get_stacktrace]
+    return 0
+  } else {
+    set ::perlpid 0
+    return 1
+  }
 }; # close_tlmgr
 
 # read a line of tlmgr output
@@ -541,11 +558,11 @@
 
   # also update displayed status info
   if {$::have_remote && $::need_update_tlmgr} {
-    .topf.luptodate configure -text [__ "Needs updating"]
+    .topfl.luptodate configure -text [__ "Needs updating"]
   } elseif $::have_remote {
-    .topf.luptodate configure -text [__ "Up to date"]
+    .topfl.luptodate configure -text [__ "Up to date"]
   } else {
-    .topf.luptodate configure -text [__ "Unknown"]
+    .topfl.luptodate configure -text [__ "Unknown"]
   }
   # ... and status of update buttons
   selective_dis_enable
@@ -732,7 +749,7 @@
   }
   get_platforms
   set ::have_remote 1
-  .topf.loaded configure -text [__ "Loaded"] -foreground black
+  .topfl.loaded configure -text [__ "Loaded"] -foreground black
   update_globals
   return 1
 } ; # get_packages_info_remote
@@ -1079,7 +1096,7 @@
   }
   if $changes {
     set_repos_in_tlmgr
-    .topf.lrepos configure -text [print_repos]
+    .topfl.lrepos configure -text [print_repos]
     close_tlmgr
     start_tlmgr
     # reload remote package information
@@ -1506,22 +1523,26 @@
 
 ##### package-related #####
 
+proc update_self_q {} {
+  set ans [tk_messageBox -type okcancel -icon info -message \
+      [string cat [__ "If update fails, try on a command-line:"] \
+         "\ntlmgr update --self\n" \
+         [__ "Use an admininstrative command prompt for an admin install."]]]
+  return [$ans eq ok]
+}
+
 proc update_tlmgr {} {
   if {! $::need_update_tlmgr} {
     tk_messageBox -message [__ "Nothing to do!"]
     return
   }
-  if {$::tcl_platform(platform) eq "windows"} {
-    set ans [tk_messageBox -type okcancel -icon info -message \
-        [string cat [__ "If update fails, try on a command-line:"] \
-           "\ntlmgr update --self\n" \
-             [__ "Use an administrative command prompt for an admin install."]]]
-    if {$ans eq "cancel"} return
-  }
+  if {$::tcl_platform(platform) eq "windows" && ! [update_self_q]} return
   run_cmd "update --self" 1
   vwait ::done_waiting
   # tlmgr restarts itself automatically
   update_local_revnumbers
+  .topfr.linfra configure -text \
+      "tlmgr: r[dict get $::pkgs texlive.infra localrev]"
   collect_filtered
 } ; # update_tlmgr
 
@@ -2044,36 +2065,44 @@
       -in .endbuttons -side right
   ppack [ttk::button .r -text [__ "Restart self"] -command restart_self] \
       -in .endbuttons -side right
-  ppack [ttk::button .t -text [__ "Restart tlmgr"] \
-             -command {close_tlmgr; start_tlmgr}] \
-      -in .endbuttons -side right
+  # ppack [ttk::button .t -text [__ "Restart tlmgr"] \
+  #            -command {close_tlmgr; start_tlmgr}] \
+  #     -in .endbuttons -side right
   ttk::button .showlogs -text [__ "Show logs"] -command show_logs
   ppack .showlogs -in .endbuttons -side right
 
   # various info
-  # frame .topf -background white -borderwidth 2 -relief sunken
   ppack [ttk::frame .topf] -in .bg -side top -anchor w -fill x
-  pack [ttk::separator .sp -orient horizontal] \
-      -in .bg -side top -fill x -pady 6
 
-  ttk::label .topf.llrepo -text [__ "Default repositories"] -anchor w
-  pgrid .topf.llrepo -row 0 -column 0 -sticky nw
-  ttk::label .topf.lrepos -text "" -justify left -anchor w
-  pgrid .topf.lrepos -row 0 -column 1 -sticky nw
-  ttk::label .topf.loaded -text [__ "Not loaded"] -foreground red -anchor w
-  pgrid .topf.loaded -row 1 -column 1 -sticky w
+  # left frame
+  ppack [ttk::frame .topfl] -in .topf -side left -anchor nw
 
-  ttk::label .topf.lluptodate -text [__ "TL Manager up to date?"] -anchor w
-  pgrid .topf.lluptodate -row 2 -column 0 -sticky w
-  ttk::label .topf.luptodate -text [__ "Unknown"] -anchor w
-  pgrid .topf.luptodate -row 2 -column 1 -sticky w
+  ttk::label .topfl.llrepo -text [__ "Default repositories"] -anchor w
+  pgrid .topfl.llrepo -row 0 -column 0 -sticky nw
+  ttk::label .topfl.lrepos -text "" -justify left -anchor w
+  pgrid .topfl.lrepos -row 0 -column 1 -sticky nw
+  ttk::label .topfl.loaded -text [__ "Not loaded"] -foreground red -anchor w
+  pgrid .topfl.loaded -row 1 -column 1 -sticky w
 
-  ttk::label .topf.llcmd -anchor w -text [__ "Last tlmgr command:"] -anchor w \
+  ttk::label .topfl.lluptodate -text [__ "TL Manager up to date?"] -anchor w
+  pgrid .topfl.lluptodate -row 2 -column 0 -sticky w
+  ttk::label .topfl.luptodate -text [__ "Unknown"] -anchor w
+  pgrid .topfl.luptodate -row 2 -column 1 -sticky w
+
+  ttk::label .topfl.llcmd -text [__ "Last tlmgr command:"] -anchor w \
       -wraplength [expr {60*$::cw}] -justify left
-  pgrid .topf.llcmd -row 3 -column 0 -sticky w
-  ttk::label .topf.lcmd -anchor w -textvariable ::last_cmd -anchor w
-  pgrid .topf.lcmd -row 3 -column 1 -sticky w
+  pgrid .topfl.llcmd -row 3 -column 0 -sticky w
+  ttk::label .topfl.lcmd -textvariable ::last_cmd -anchor w
+  pgrid .topfl.lcmd -row 3 -column 1 -sticky w
 
+  # right frame
+  ppack [ttk::frame .topfr] -in .topf -side right -anchor ne
+  pack [ttk::label .topfr.linfra -text "some"] -side top -anchor e
+  pack [ttk::label .topfr.lshell -text "more"] -side top -anchor e
+
+  pack [ttk::separator .sp -orient horizontal] \
+      -in .bg -side top -fill x -pady 6
+
   # package list
   ttk::label .lpack -text [__ "Package list"] -font TkHeadingFont -anchor w
   pack .lpack -in .bg -side top -padx 3 -pady [list 15 3] -fill x
@@ -2263,8 +2292,13 @@
 
   start_tlmgr
   get_repos_from_tlmgr
-  .topf.lrepos configure -text [print_repos]
+  .topfl.lrepos configure -text [print_repos]
   get_packages_info_local
+  # svns for  tlmgr and tlshell
+  .topfr.linfra configure -text \
+      "tlmgr: r[dict get $::pkgs texlive.infra localrev]"
+  .topfr.lshell configure -text \
+      "tlshell: r[dict get $::pkgs tlshell localrev]"
   collect_filtered ; # invokes display_packages_info
   selective_dis_enable
 }; # initialize



More information about the tex-live-commits mailing list