From 3e1d069f8ebcd45f1688396d902065f91b545b6c Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Mon, 8 Jul 2019 19:09:16 +0000 Subject: Add -nocomplain to glob to make it accept empty directories git-svn-id: svn://tug.org/texlive/trunk@51579 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/tlshell/tlshell.tcl | 2 +- Master/tlpkg/installer/install-tl-gui.tcl | 2 +- Master/tlpkg/tltcl/tltcl.tcl | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Master/texmf-dist/scripts/tlshell/tlshell.tcl b/Master/texmf-dist/scripts/tlshell/tlshell.tcl index 85598ad7e7f..cc7f43e5e28 100755 --- a/Master/texmf-dist/scripts/tlshell/tlshell.tcl +++ b/Master/texmf-dist/scripts/tlshell/tlshell.tcl @@ -1434,7 +1434,7 @@ proc restore_backups_dialog {} { } set pwd0 [pwd] cd $bdir - set backups [lsort [glob *.tar.xz]] + set backups [lsort [glob -nocomplain *.tar.xz]] if {[llength $backups] == 0} { tk_messageBox -message [__ "No backups found in $bdir"] return diff --git a/Master/tlpkg/installer/install-tl-gui.tcl b/Master/tlpkg/installer/install-tl-gui.tcl index 5545d31437a..007f274dbb3 100755 --- a/Master/tlpkg/installer/install-tl-gui.tcl +++ b/Master/tlpkg/installer/install-tl-gui.tcl @@ -98,7 +98,7 @@ set ::td_warned 0 proc is_nonempty {td} { if {! [file exists $td]} {return 0} - return [expr {[llength [glob -directory $td *]] > 0}] + return [expr {[llength [glob -nocomplain -directory $td *]] > 0}] } proc td_warn {td} { diff --git a/Master/tlpkg/tltcl/tltcl.tcl b/Master/tlpkg/tltcl/tltcl.tcl index db0157a6d84..06e6710a0b2 100644 --- a/Master/tlpkg/tltcl/tltcl.tcl +++ b/Master/tlpkg/tltcl/tltcl.tcl @@ -180,7 +180,8 @@ proc normalize_argv {} { set s [lindex $::argv $i] if {[string range $s 0 1] eq "--"} { set s [string range $s 1 end] - set ::argv [lreplace $::argv $i $i $s] + #set ::argv [lreplace $::argv $i $i $s] + lset ::argv $i $s } set j [string first "=" $s] if {$j > 0} { @@ -257,7 +258,7 @@ proc load_translations {} { set maybe "" set ::lang [string tolower $::lang] set tdir [file join $::instroot "tlpkg" "translations"] - foreach f [glob -directory $tdir *.po] { + foreach f [glob -nocomplain -directory $tdir *.po] { set ln_f [string tolower [string range [file tail $f] 0 end-3]] if {$ln_f eq $::lang} { set messcat $f @@ -530,7 +531,7 @@ proc native_slashify {s} { if {$::tcl_platform(platform) eq "unix"} { - # Based on the tcl/tk widget demo. + # Based on the directory browser from the tcl/tk widget demo. # Also for MacOS, because we want to see /usr. # For windows, the native browser widget is better. -- cgit v1.2.3