texlive[49091] Master: Fixes locale detection; tlshell searchpath

commits+siepo at tug.org commits+siepo at tug.org
Tue Nov 6 14:16:52 CET 2018


Revision: 49091
          http://tug.org/svn/texlive?view=revision&revision=49091
Author:   siepo
Date:     2018-11-06 14:16:52 +0100 (Tue, 06 Nov 2018)
Log Message:
-----------
Fixes locale detection; tlshell searchpath

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

Modified: trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl
===================================================================
--- trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl	2018-11-06 07:32:02 UTC (rev 49090)
+++ trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl	2018-11-06 13:16:52 UTC (rev 49091)
@@ -10,6 +10,27 @@
 # 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 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 @@
   # 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:

Modified: trunk/Master/tlpkg/TeXLive/tltcl.tcl
===================================================================
--- trunk/Master/tlpkg/TeXLive/tltcl.tcl	2018-11-06 07:32:02 UTC (rev 49090)
+++ trunk/Master/tlpkg/TeXLive/tltcl.tcl	2018-11-06 13:16:52 UTC (rev 49091)
@@ -95,11 +95,11 @@
       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 @@
       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 @@
           set inmsgstr 1
           set inmsgid 0
         }
+        if [chan eof $fid] break
       }
       chan close $fid
     }



More information about the tex-live-commits mailing list