texlive[46330] Master/texmf-dist/scripts/tlshell/tlshell.tcl:
commits+siepo at tug.org
commits+siepo at tug.org
Tue Jan 16 21:36:22 CET 2018
Revision: 46330
http://tug.org/svn/texlive?view=revision&revision=46330
Author: siepo
Date: 2018-01-16 21:36:22 +0100 (Tue, 16 Jan 2018)
Log Message:
-----------
Tlshell: added generate... actions
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 2018-01-16 01:23:48 UTC (rev 46329)
+++ trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl 2018-01-16 20:36:22 UTC (rev 46330)
@@ -163,8 +163,11 @@
wm state $wnd normal
raise $wnd $p
tkwait visibility $wnd
- focus $wnd
- grab set $wnd
+ if {$::tcl_platform(platform) ne "windows"} {
+ # dont understand why these give trouble in windows
+ focus $wnd
+ grab set $wnd
+ }
} ; # place_dlg
proc long_message {str type {p "."}} {
@@ -518,7 +521,7 @@
.tllg.log.tx configure -state normal
.tllg.log.tx insert end "$l\n"
if {$::tcl_platform(os) ne "Darwin"} {
- .tllg.err.tx configure -state disabled
+ .tllg.log.tx configure -state disabled
}
} elseif {$mode eq "init"} {
show_logs
@@ -1761,6 +1764,38 @@
run_cmd "paper paper $p" log_widget_cb
}
+##### running external commands #####
+
+# For capturing an external command, we need a separate output channel,
+# but we reuse ::out_log.
+# stderr is bundled with stdout so ::err_log should stay empty.
+proc read_capt {} {
+ set l "" ; # will contain the line to be read
+ if {([catch {chan gets $::capt l} len] || [chan eof $::capt])} {
+ catch {chan close $::capt}
+ log_widget_cb "finish"
+ set ::done_waiting 1
+ } elseif {$len >= 0} {
+ lappend ::out_log $l
+ log_widget_cb "line" $l
+ }
+}; # read_capt
+
+proc run_external {cmd mess} {
+ set ::out_log {}
+ set ::err_log {}
+ lappend ::out_log $mess
+ unset -nocomplain ::done_waiting
+ # dont understand why, on windows, start_tlmgr does not trigger
+ # a console window but this proc does
+ if [catch {open "|$cmd 2>&1" "r"} ::capt] {
+ tk_messageBox -message "Failure to launch $cmd"
+ }
+ chan configure $::capt -buffering line -blocking 0
+ chan event $::capt readable read_capt
+ log_widget_cb "init"
+}
+
##### main window #####
proc make_widgets {} {
@@ -1802,6 +1837,7 @@
-command {get_packages_info_remote; collect_filtered}
.mn.file add command -command {destroy .} -label "Exit" -underline 1
+ # inx: keeping count where needed, i.e. when an entry needs to be referenced
.mn add cascade -label "Packages" -menu .mn.pkg
menu .mn.pkg
set inx 0
@@ -1825,9 +1861,14 @@
-command restore_backups_dialog
}
- #.mn add cascade -label "Actions" -menu .mn.act -underline 0
- #menu .mn.act
- #set inx 0
+ .mn add cascade -label "Actions" -menu .mn.act -underline 0
+ menu .mn.act
+ .mn.act add command -label "Regenerate filename database" -command \
+ {run_external "mktexlsr" "Regenerating filename database..."}
+ .mn.act add command -label "Regenerate formats" -command \
+ {run_external "fmtutil-sys --all" "Rebuilding formats..."}
+ .mn.act add command -label "Regenerate fontmaps" -command \
+ {run_external "updmap-sys" "Rebuilding fontmap files..."}
.mn add cascade -label "Options" -menu .mn.opt -underline 0
menu .mn.opt
@@ -1846,9 +1887,6 @@
.mn.opt add command -label "Platforms..." -command platform_select
}
- #.mn add cascade -label "Actions" -menu .mn.act -underline 0
- #menu .mn.act
-
.mn add cascade -label "Help" -menu .mn.help -underline 0
menu .mn.help
.mn.help add command -command {tk_messageBox -message "Helpless"} \
More information about the tex-live-commits
mailing list