lassign [dict values $argd] leaders opts values received
set pathglobs [dict get $opts -pathglob]
set binglobs [dict get $values binglob]
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set sep ";"
} else {
# : ok for linux/bsd ... mac?
@ -6386,6 +6386,7 @@ namespace eval punk {
#Sometimes PATHEXT includes an entry of just a dot - which means files with no extension are considered executable.
#We need to account for this in our glob pattern.
set pathexts [list]
#review - we assume this is only relevant on windows for now.
if {[info exists ::env(PATHEXT)]} {
set env_pathexts [split $::env(PATHEXT) ";"]
#set pathexts [lmap e $env_pathexts {string tolower $e}]
@ -6442,7 +6443,7 @@ namespace eval punk {
set d_index_executables [dict create] ;#key is path index, value is list of executables in that path
set path_idx 0
foreach p $all_paths {
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set pnorm [string tolower $p]
} else {
set pnorm $p
@ -6461,7 +6462,7 @@ namespace eval punk {
#If we don't normalize the path here - then trailing backslashes on windows can cause a problem with the -tail glob returning a leading slash on the executable names.
#also as we don't necessarily normalize the resulting final path with executable - we want the case to be correct.
set pnormglob [file normalize $p]
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
#TCL's glob on windows is case-insensitive, but in some cases return the result with the case as globbed for regardless of the actual case on the filesystem.
#(This seems to occur when the pattern does *not* contain a wildcard and is probably a bug)
@ -6501,7 +6502,7 @@ namespace eval punk {
dict set d_index_executables $path_idx $executables
foreach exe $executables {
#todo - other case-insensitive platforms/filesystems.
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
#on case
@ -6533,7 +6534,7 @@ namespace eval punk {
#However we do need to add the path index to the path_indices for each executable that is found in this path - as this will affect which paths are shown as overshadowing which executables.
set executables [dict get $d_index_executables [lindex [dict get $d_path_info $pnorm indices] 0]] ;#get executables for this path
foreach exe $executables {
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
set exe_key $exe
@ -6596,7 +6597,11 @@ namespace eval punk {
# continue
#}
set thisrow [list $pidx]
if {$is_windows} {
set pnorm [string tolower $p]
} else {
set pnorm $p
}
if {[string length $pnorm] > 1} {
set lastchar [string index $pnorm end]
if {$lastchar eq "/" || $lastchar eq "\\"} {
@ -6617,15 +6622,28 @@ namespace eval punk {
set display_executables [list]
foreach exe $executables {
set matched_binglob 0
if {$is_windows} {
foreach bg $binglobs {
#review - -nocase only on case-insensitive platforms/filesystems?
#- but it is simpler to just apply it to all platforms here rather than trying to determine case-sensitivity of each path.
#todo - mac has case-insensitive filesystem by default.
if {[string match -nocase $bg $exe]} {
set matched_binglob 1
continue
}
}
} else {
foreach bg $binglobs {
if {[string match $bg $exe]} {
set matched_binglob 1
continue
}
}
}
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
set exe_key $exe
}
if {[dict exists $d_bin_info $exe_key]} {
set bindata [dict get $d_bin_info $exe_key]
set path_indices [dict get $bindata path_indices]
@ -6738,7 +6756,11 @@ namespace eval punk {
set executables [dict get $d_index_executables $original_path_idx]
lassign [dict values $argd] leaders opts values received
set pathglobs [dict get $opts -pathglob]
set binglobs [dict get $values binglob]
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set sep ";"
} else {
# : ok for linux/bsd ... mac?
@ -6386,6 +6386,7 @@ namespace eval punk {
#Sometimes PATHEXT includes an entry of just a dot - which means files with no extension are considered executable.
#We need to account for this in our glob pattern.
set pathexts [list]
#review - we assume this is only relevant on windows for now.
if {[info exists ::env(PATHEXT)]} {
set env_pathexts [split $::env(PATHEXT) ";"]
#set pathexts [lmap e $env_pathexts {string tolower $e}]
@ -6442,7 +6443,7 @@ namespace eval punk {
set d_index_executables [dict create] ;#key is path index, value is list of executables in that path
set path_idx 0
foreach p $all_paths {
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set pnorm [string tolower $p]
} else {
set pnorm $p
@ -6461,7 +6462,7 @@ namespace eval punk {
#If we don't normalize the path here - then trailing backslashes on windows can cause a problem with the -tail glob returning a leading slash on the executable names.
#also as we don't necessarily normalize the resulting final path with executable - we want the case to be correct.
set pnormglob [file normalize $p]
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
#TCL's glob on windows is case-insensitive, but in some cases return the result with the case as globbed for regardless of the actual case on the filesystem.
#(This seems to occur when the pattern does *not* contain a wildcard and is probably a bug)
@ -6501,7 +6502,7 @@ namespace eval punk {
dict set d_index_executables $path_idx $executables
foreach exe $executables {
#todo - other case-insensitive platforms/filesystems.
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
#on case
@ -6533,7 +6534,7 @@ namespace eval punk {
#However we do need to add the path index to the path_indices for each executable that is found in this path - as this will affect which paths are shown as overshadowing which executables.
set executables [dict get $d_index_executables [lindex [dict get $d_path_info $pnorm indices] 0]] ;#get executables for this path
foreach exe $executables {
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
set exe_key $exe
@ -6596,7 +6597,11 @@ namespace eval punk {
# continue
#}
set thisrow [list $pidx]
if {$is_windows} {
set pnorm [string tolower $p]
} else {
set pnorm $p
}
if {[string length $pnorm] > 1} {
set lastchar [string index $pnorm end]
if {$lastchar eq "/" || $lastchar eq "\\"} {
@ -6617,15 +6622,28 @@ namespace eval punk {
set display_executables [list]
foreach exe $executables {
set matched_binglob 0
if {$is_windows} {
foreach bg $binglobs {
#review - -nocase only on case-insensitive platforms/filesystems?
#- but it is simpler to just apply it to all platforms here rather than trying to determine case-sensitivity of each path.
#todo - mac has case-insensitive filesystem by default.
if {[string match -nocase $bg $exe]} {
set matched_binglob 1
continue
}
}
} else {
foreach bg $binglobs {
if {[string match $bg $exe]} {
set matched_binglob 1
continue
}
}
}
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
set exe_key $exe
}
if {[dict exists $d_bin_info $exe_key]} {
set bindata [dict get $d_bin_info $exe_key]
set path_indices [dict get $bindata path_indices]
@ -6738,7 +6756,11 @@ namespace eval punk {
set executables [dict get $d_index_executables $original_path_idx]
lassign [dict values $argd] leaders opts values received
set pathglobs [dict get $opts -pathglob]
set binglobs [dict get $values binglob]
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set sep ";"
} else {
# : ok for linux/bsd ... mac?
@ -6386,6 +6386,7 @@ namespace eval punk {
#Sometimes PATHEXT includes an entry of just a dot - which means files with no extension are considered executable.
#We need to account for this in our glob pattern.
set pathexts [list]
#review - we assume this is only relevant on windows for now.
if {[info exists ::env(PATHEXT)]} {
set env_pathexts [split $::env(PATHEXT) ";"]
#set pathexts [lmap e $env_pathexts {string tolower $e}]
@ -6442,7 +6443,7 @@ namespace eval punk {
set d_index_executables [dict create] ;#key is path index, value is list of executables in that path
set path_idx 0
foreach p $all_paths {
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set pnorm [string tolower $p]
} else {
set pnorm $p
@ -6461,7 +6462,7 @@ namespace eval punk {
#If we don't normalize the path here - then trailing backslashes on windows can cause a problem with the -tail glob returning a leading slash on the executable names.
#also as we don't necessarily normalize the resulting final path with executable - we want the case to be correct.
set pnormglob [file normalize $p]
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
#TCL's glob on windows is case-insensitive, but in some cases return the result with the case as globbed for regardless of the actual case on the filesystem.
#(This seems to occur when the pattern does *not* contain a wildcard and is probably a bug)
@ -6501,7 +6502,7 @@ namespace eval punk {
dict set d_index_executables $path_idx $executables
foreach exe $executables {
#todo - other case-insensitive platforms/filesystems.
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
#on case
@ -6533,7 +6534,7 @@ namespace eval punk {
#However we do need to add the path index to the path_indices for each executable that is found in this path - as this will affect which paths are shown as overshadowing which executables.
set executables [dict get $d_index_executables [lindex [dict get $d_path_info $pnorm indices] 0]] ;#get executables for this path
foreach exe $executables {
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
set exe_key $exe
@ -6596,7 +6597,11 @@ namespace eval punk {
# continue
#}
set thisrow [list $pidx]
if {$is_windows} {
set pnorm [string tolower $p]
} else {
set pnorm $p
}
if {[string length $pnorm] > 1} {
set lastchar [string index $pnorm end]
if {$lastchar eq "/" || $lastchar eq "\\"} {
@ -6617,15 +6622,28 @@ namespace eval punk {
set display_executables [list]
foreach exe $executables {
set matched_binglob 0
if {$is_windows} {
foreach bg $binglobs {
#review - -nocase only on case-insensitive platforms/filesystems?
#- but it is simpler to just apply it to all platforms here rather than trying to determine case-sensitivity of each path.
#todo - mac has case-insensitive filesystem by default.
if {[string match -nocase $bg $exe]} {
set matched_binglob 1
continue
}
}
} else {
foreach bg $binglobs {
if {[string match $bg $exe]} {
set matched_binglob 1
continue
}
}
}
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
set exe_key $exe
}
if {[dict exists $d_bin_info $exe_key]} {
set bindata [dict get $d_bin_info $exe_key]
set path_indices [dict get $bindata path_indices]
@ -6738,7 +6756,11 @@ namespace eval punk {
set executables [dict get $d_index_executables $original_path_idx]
lassign [dict values $argd] leaders opts values received
set pathglobs [dict get $opts -pathglob]
set binglobs [dict get $values binglob]
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set sep ";"
} else {
# : ok for linux/bsd ... mac?
@ -6386,6 +6386,7 @@ namespace eval punk {
#Sometimes PATHEXT includes an entry of just a dot - which means files with no extension are considered executable.
#We need to account for this in our glob pattern.
set pathexts [list]
#review - we assume this is only relevant on windows for now.
if {[info exists ::env(PATHEXT)]} {
set env_pathexts [split $::env(PATHEXT) ";"]
#set pathexts [lmap e $env_pathexts {string tolower $e}]
@ -6442,7 +6443,7 @@ namespace eval punk {
set d_index_executables [dict create] ;#key is path index, value is list of executables in that path
set path_idx 0
foreach p $all_paths {
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set pnorm [string tolower $p]
} else {
set pnorm $p
@ -6461,7 +6462,7 @@ namespace eval punk {
#If we don't normalize the path here - then trailing backslashes on windows can cause a problem with the -tail glob returning a leading slash on the executable names.
#also as we don't necessarily normalize the resulting final path with executable - we want the case to be correct.
set pnormglob [file normalize $p]
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
#TCL's glob on windows is case-insensitive, but in some cases return the result with the case as globbed for regardless of the actual case on the filesystem.
#(This seems to occur when the pattern does *not* contain a wildcard and is probably a bug)
@ -6501,7 +6502,7 @@ namespace eval punk {
dict set d_index_executables $path_idx $executables
foreach exe $executables {
#todo - other case-insensitive platforms/filesystems.
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
#on case
@ -6533,7 +6534,7 @@ namespace eval punk {
#However we do need to add the path index to the path_indices for each executable that is found in this path - as this will affect which paths are shown as overshadowing which executables.
set executables [dict get $d_index_executables [lindex [dict get $d_path_info $pnorm indices] 0]] ;#get executables for this path
foreach exe $executables {
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
set exe_key $exe
@ -6596,7 +6597,11 @@ namespace eval punk {
# continue
#}
set thisrow [list $pidx]
if {$is_windows} {
set pnorm [string tolower $p]
} else {
set pnorm $p
}
if {[string length $pnorm] > 1} {
set lastchar [string index $pnorm end]
if {$lastchar eq "/" || $lastchar eq "\\"} {
@ -6617,15 +6622,28 @@ namespace eval punk {
set display_executables [list]
foreach exe $executables {
set matched_binglob 0
if {$is_windows} {
foreach bg $binglobs {
#review - -nocase only on case-insensitive platforms/filesystems?
#- but it is simpler to just apply it to all platforms here rather than trying to determine case-sensitivity of each path.
#todo - mac has case-insensitive filesystem by default.
if {[string match -nocase $bg $exe]} {
set matched_binglob 1
continue
}
}
} else {
foreach bg $binglobs {
if {[string match $bg $exe]} {
set matched_binglob 1
continue
}
}
}
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
set exe_key $exe
}
if {[dict exists $d_bin_info $exe_key]} {
set bindata [dict get $d_bin_info $exe_key]
set path_indices [dict get $bindata path_indices]
@ -6738,7 +6756,11 @@ namespace eval punk {
set executables [dict get $d_index_executables $original_path_idx]
lassign [dict values $argd] leaders opts values received
set pathglobs [dict get $opts -pathglob]
set binglobs [dict get $values binglob]
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set sep ";"
} else {
# : ok for linux/bsd ... mac?
@ -6386,6 +6386,7 @@ namespace eval punk {
#Sometimes PATHEXT includes an entry of just a dot - which means files with no extension are considered executable.
#We need to account for this in our glob pattern.
set pathexts [list]
#review - we assume this is only relevant on windows for now.
if {[info exists ::env(PATHEXT)]} {
set env_pathexts [split $::env(PATHEXT) ";"]
#set pathexts [lmap e $env_pathexts {string tolower $e}]
@ -6442,7 +6443,7 @@ namespace eval punk {
set d_index_executables [dict create] ;#key is path index, value is list of executables in that path
set path_idx 0
foreach p $all_paths {
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set pnorm [string tolower $p]
} else {
set pnorm $p
@ -6461,7 +6462,7 @@ namespace eval punk {
#If we don't normalize the path here - then trailing backslashes on windows can cause a problem with the -tail glob returning a leading slash on the executable names.
#also as we don't necessarily normalize the resulting final path with executable - we want the case to be correct.
set pnormglob [file normalize $p]
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
#TCL's glob on windows is case-insensitive, but in some cases return the result with the case as globbed for regardless of the actual case on the filesystem.
#(This seems to occur when the pattern does *not* contain a wildcard and is probably a bug)
@ -6501,7 +6502,7 @@ namespace eval punk {
dict set d_index_executables $path_idx $executables
foreach exe $executables {
#todo - other case-insensitive platforms/filesystems.
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
#on case
@ -6533,7 +6534,7 @@ namespace eval punk {
#However we do need to add the path index to the path_indices for each executable that is found in this path - as this will affect which paths are shown as overshadowing which executables.
set executables [dict get $d_index_executables [lindex [dict get $d_path_info $pnorm indices] 0]] ;#get executables for this path
foreach exe $executables {
if {$::tcl_platform(platform) eq "windows"} {
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
set exe_key $exe
@ -6596,7 +6597,11 @@ namespace eval punk {
# continue
#}
set thisrow [list $pidx]
if {$is_windows} {
set pnorm [string tolower $p]
} else {
set pnorm $p
}
if {[string length $pnorm] > 1} {
set lastchar [string index $pnorm end]
if {$lastchar eq "/" || $lastchar eq "\\"} {
@ -6617,15 +6622,28 @@ namespace eval punk {
set display_executables [list]
foreach exe $executables {
set matched_binglob 0
if {$is_windows} {
foreach bg $binglobs {
#review - -nocase only on case-insensitive platforms/filesystems?
#- but it is simpler to just apply it to all platforms here rather than trying to determine case-sensitivity of each path.
#todo - mac has case-insensitive filesystem by default.
if {[string match -nocase $bg $exe]} {
set matched_binglob 1
continue
}
}
} else {
foreach bg $binglobs {
if {[string match $bg $exe]} {
set matched_binglob 1
continue
}
}
}
if {$is_windows} {
set exe_key [string tolower $exe]
} else {
set exe_key $exe
}
if {[dict exists $d_bin_info $exe_key]} {
set bindata [dict get $d_bin_info $exe_key]
set path_indices [dict get $bindata path_indices]
@ -6738,7 +6756,11 @@ namespace eval punk {
set executables [dict get $d_index_executables $original_path_idx]