summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/tlshell
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2019-03-23 21:03:32 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2019-03-23 21:03:32 +0000
commitce1f196f8ea3c39c75b79ebdb7568ba3cd917aca (patch)
treea7adaa3897a8342c3f50ff2e090de654e01b59d2 /Master/texmf-dist/scripts/tlshell
parent95b78f87c5a2bd12cda6be3b03819bffb568f0a4 (diff)
Show svn revision tlshell and tlmgr; path under w32; 'update tlmgr' button commented out
git-svn-id: svn://tug.org/texlive/trunk@50554 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/tlshell')
-rwxr-xr-xMaster/texmf-dist/scripts/tlshell/tlshell.tcl108
1 files changed, 71 insertions, 37 deletions
diff --git a/Master/texmf-dist/scripts/tlshell/tlshell.tcl b/Master/texmf-dist/scripts/tlshell/tlshell.tcl
index 14621bb84a4..8db765b5eac 100755
--- a/Master/texmf-dist/scripts/tlshell/tlshell.tcl
+++ b/Master/texmf-dist/scripts/tlshell/tlshell.tcl
@@ -10,7 +10,8 @@ package require Tk
# 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 @@ if {$::tcl_platform(platform) ne "windows"} {
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 @@ proc start_tlmgr {{args ""}} {
} ; # 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 @@ proc update_globals {} {
# 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 @@ proc get_packages_info_remote {} {
}
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 @@ proc repos_commit {} {
}
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 @@ proc restore_backups_dialog {} {
##### 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,35 +2065,43 @@ proc populate_main {} {
-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
@@ -2263,8 +2292,13 @@ proc initialize {} {
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