texlive[50776] Master/texmf-dist/scripts/tlshell/tlshell.tcl: On

commits+siepo at tug.org commits+siepo at tug.org
Fri Apr 5 17:10:11 CEST 2019


Revision: 50776
          http://tug.org/svn/texlive?view=revision&revision=50776
Author:   siepo
Date:     2019-04-05 17:10:11 +0200 (Fri, 05 Apr 2019)
Log Message:
-----------
On windows, do not update tlmgr from tlshell

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-04-05 14:13:24 UTC (rev 50775)
+++ trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl	2019-04-05 15:10:11 UTC (rev 50776)
@@ -218,6 +218,9 @@
     foreach b [list .mrk_inst .mrk_upd] {
       $b state disabled
     }
+    if {$::tcl_platform(platform) eq "windows"} {
+      .upd_all state disabled
+    }
   } elseif {!$::need_update_tlmgr} {
     .upd_tlmgr state disabled
   }
@@ -1514,12 +1517,16 @@
 
 ##### 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 administrative command prompt for an admin install."]]]
-  return [expr {$ans eq "ok"}]
+proc update_self_w32 {} {
+  if $::multiuser {
+    set mess \
+        [__ "Close this shell and run in an administrative command-prompt:"]
+  } else {
+    set mess [__ "Close this shell and run in a command-prompt:"]
+  }
+  set mess [string cat $mess "\n\ntlmgr update --self"]
+  tk_messageBox -message $mess
+  return
 }
 
 proc update_tlmgr {} {
@@ -1527,7 +1534,10 @@
     tk_messageBox -message [__ "Nothing to do!"]
     return
   }
-  if {$::tcl_platform(platform) eq "windows" && ! [update_self_q]} return
+  if {$::tcl_platform(platform) eq "windows"} {
+    update_self_w32
+    return
+  }
   run_cmd "update --self" 1
   vwait ::done_waiting
   # tlmgr restarts itself automatically
@@ -1540,6 +1550,9 @@
 proc update_all {} {
   set updated_tlmgr 0
   if $::need_update_tlmgr {
+    if {$::tcl_platform(platform) eq "windows"} {
+      return ; # just to be sure; 'update all' button should be disabled
+    }
     run_cmd "update --self" 1
     vwait ::done_waiting
     # tlmgr restarts itself automatically
@@ -2092,6 +2105,9 @@
 
   # right frame
   ppack [ttk::frame .topfr] -in .topf -side right -anchor ne
+  if {$::tcl_platform(platform) eq "windows"} {
+    pack [ttk::label .topfr.ladmin] -side top -anchor e
+  }
   pack [ttk::label .topfr.lroot] -side top -anchor e
   .topfr.lroot configure -text [__ "Root at %s" $::instroot]
   pack [ttk::label .topfr.linfra] -side top -anchor e
@@ -2296,6 +2312,15 @@
   }
 
   start_tlmgr
+  if {$::tcl_platform(platform) eq "windows"} {
+    run_cmd_waiting "option multiuser"
+    set ::multiuser 0
+    foreach l $::out_log {
+      if [regexp {^\s*multiuser\s+([01])\s*$} $l d ::multiuser] break
+    }
+    .topfr.ladmin configure -text \
+        [expr {$::multiuser ? [__ "Multi-user"] : [__ "Single-user"]}]
+  }
   get_repos_from_tlmgr
   .topfl.lrepos configure -text [print_repos]
   get_packages_info_local



More information about the tex-live-commits mailing list