summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2018-11-06 13:16:52 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2018-11-06 13:16:52 +0000
commit8331d77f4583d3cd265d7b495da63da3354b3974 (patch)
tree867e53fa39355debdf1d8add3d28cbbd57d73a79 /Master
parentce56884c340c40aaf5c90d736a404208ef486943 (diff)
Fixes locale detection; tlshell searchpath
git-svn-id: svn://tug.org/texlive/trunk@49091 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf-dist/scripts/tlshell/tlshell.tcl42
-rw-r--r--Master/tlpkg/TeXLive/tltcl.tcl4
2 files changed, 26 insertions, 20 deletions
diff --git a/Master/texmf-dist/scripts/tlshell/tlshell.tcl b/Master/texmf-dist/scripts/tlshell/tlshell.tcl
index 02a74e49807..23656017587 100755
--- a/Master/texmf-dist/scripts/tlshell/tlshell.tcl
+++ b/Master/texmf-dist/scripts/tlshell/tlshell.tcl
@@ -10,6 +10,27 @@ package require Tk
# security: disable send
catch {rename send {}}
+# 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]
+ cd $texbin
+ set texbin [pwd]
+ cd $savedir
+ # prepend texbin to PATH, unless it is already the _first_
+ # path component
+ set dirs [split $::env(PATH) ":"]
+ if {[lindex $dirs 0] ne $texbin} {
+ set ::env(PATH) "${texbin}:$::env(PATH)"
+ }
+ unset texbin
+ unset savedir
+ unset dirs
+ # now is a good time to ask tlmgr for the _TL_ name of our platform
+ set ::our_platform [exec tlmgr print-platform]
+}
+
# declarations and utilities shared with install-tl-gui.tcl
set ::instroot [exec kpsewhich -var-value=TEXMFROOT]
source [file join $::instroot "tlpkg" "TeXLive" "tltcl.tcl"]
@@ -2113,22 +2134,7 @@ proc populate_main {} {
proc initialize {} {
# seed random numbers
expr {srand([clock seconds])}
- # unix: make sure TL comes first on process searchpath
- if {$::tcl_platform(platform) ne "windows"} {
- set texbin [file dirname [file normalize [info script]]]
- set savedir [pwd]
- cd $texbin
- set texbin [pwd]
- cd $savedir
- # prepend texbin to PATH, unless it is already the _first_
- # path component
- set dirs [split $::env(PATH) ":"]
- if {[lindex $dirs 0] ne $texbin} {
- set ::env(PATH) "${texbin}:$::env(PATH)"
- }
- # now is a good time to ask tlmgr for the _TL_ name of our platform
- set ::our_platform [exec tlmgr print-platform]
- }
+
# directory for temp files
set attemptdirs {}
foreach tmp {TMPDIR TEMP TMP} {
@@ -2173,8 +2179,8 @@ proc initialize {} {
# languages
set ::langs [list "en"]
foreach l [glob -nocomplain -directory \
- [file join $::instroot "tlpkg" "translations"] *.msg] {
- lappend ::langs [string range [file tail $l] 0 end-4]
+ [file join $::instroot "tlpkg" "translations"] *.po] {
+ lappend ::langs [string range [file tail $l] 0 end-3]
}
# in case we are going to do something with json:
diff --git a/Master/tlpkg/TeXLive/tltcl.tcl b/Master/tlpkg/TeXLive/tltcl.tcl
index d0048b26d21..72b16adbb88 100644
--- a/Master/tlpkg/TeXLive/tltcl.tcl
+++ b/Master/tlpkg/TeXLive/tltcl.tcl
@@ -95,11 +95,11 @@ proc load_translations {} {
if [catch {open [file join $d "tlmgr" "config"] r} fid] continue
while 1 {
if [catch {chan gets $fid} l] break
- if [chan eof $fid] break
if {[regexp {^\s*gui-lang\s*=\s*(\S+)$} $l m ::lang]} {
chan close $fid
break
}
+ if [chan eof $fid] break
}
if {[info exists ::lang] && $::lang ne ""} break
}
@@ -145,7 +145,6 @@ proc load_translations {} {
set msgstr ""
while 1 {
if [catch {chan gets $fid} l] break
- if [chan eof $fid] break
if [regexp {^\s*#} $l] continue
if [regexp {^\s*$} $l] {
# empty line separates msgid/msgstr pairs
@@ -192,6 +191,7 @@ proc load_translations {} {
set inmsgstr 1
set inmsgid 0
}
+ if [chan eof $fid] break
}
chan close $fid
}