diff --git a/src/make.tcl b/src/make.tcl index 4aedf39f..8f7829c4 100644 --- a/src/make.tcl +++ b/src/make.tcl @@ -2447,6 +2447,7 @@ set rt_sourcefolder $sourcefolder/runtime ;#where our config lives #review - when building kits for other platforms - it's unlikely runtime will be marked as executable - we should probably process all files in runtime folder except those with certain extensions +set runtimes [list] if {[file dirname [info nameofexecutable]] eq $rtfolder} { #fix so that we can find and use a runtime tclkit that is currently in use as the runtime that is running this script. # - when the current runtime is using a runtime in the rtfolder that is a tclkit, it is mounted at the same path as the physical file and so appears to Tcl as if it's a directory. @@ -2456,13 +2457,13 @@ if {[file dirname [info nameofexecutable]] eq $rtfolder} { } else { exec cp [info nameofexecutable] $rtfolder/[file tail [info nameofexecutable]]_BUILDCOPY } + lappend runtimes [file tail [info nameofexecutable]] } set rtfolder_files [glob -nocomplain -dir $rtfolder -types {f} -tail *] set exclusions {.config .md .ico .txt .doc .pdf .htm .html} ;#we don't encourage other files in runtime folder aside from mapvfs.config - but lets ignore some common possibilities lappend exclusions .zip .7z .pea .bz2 .tar .gz .tgz .z .xz ;#don't allow archives to directly be treated as runtimes - tolerate presence but require user to unpack or rename if they're to be used as runtimes lappend exclusions .tail ;#result of running sdx mksplit on a kit - in theory the .head could be used - review/test -set runtimes [list] foreach f $rtfolder_files { if {[string match "*_BUILDCOPY*" $f]} { continue @@ -2470,7 +2471,9 @@ foreach f $rtfolder_files { if {[string tolower [file extension $f]] in $exclusions} { continue } - lappend runtimes $f + if {$f ni $runtimes} { + lappend runtimes $f + } } if {![llength $runtimes]} { puts stderr "No executable runtimes found in $rtfolder - unable to build any .vfs folders into executables."