@@ -12,14 +12,10 @@ set tcl_library [file join $mountpoint lib tcl$tcl_version] set tcl_libPath [list $tcl_library [file join $mountpoint lib]] # the following code only gets executed once on startup if {[info exists ::TCLKIT_INITVFS]} { - catch { - load {} vfs - } - # lookup and emulate "source" of lib/vfs/{vfs*.tcl,mk4vfs.tcl} switch -- $::tclKitStorage { "mk4" { # must use raw MetaKit calls because VFS is not yet in place set d [mk::select exe.dirs parent 0 name lib] @@ -135,10 +131,15 @@ set tcl_library [file join $mountpoint lib tcl$tcl_version] set tcl_libPath [list $tcl_library [file join $mountpoint lib]] vfs::filesystem mount $mountpoint $vfsHandler + + # This loads everything needed for "clock scan" to work + # "clock scan" is used within "vfs::zip", which may be + # loaded before this is run causing the root VFS to break + catch { clock scan } } # load config settings file if present namespace eval ::vfs { variable tclkit_version 1 } catch { uplevel #0 [list source [file join $mountpoint config.tcl]] } @@ -147,15 +148,10 @@ uplevel #0 [list source [file join $tcl_library init.tcl]] # reset auto_path, so that init.tcl's search outside of tclkit is cancelled set auto_path $tcl_libPath - # This loads everything needed for "clock scan" to work - # "clock scan" is used within "vfs::zip", which may be - # loaded before this is run causing the root VFS to break - catch { clock scan } - if {$::TCLKIT_TYPE == "kitdll"} { # Set a maximum seek to avoid reading the entire file looking for a # zip header catch { package require vfs::zip @@ -166,27 +162,26 @@ ## Mount the VFS from the Shared Object if {[info exists ::TCLKIT_INITVFS] && [info exists ::tclKitFilename]} { catch { vfs::zip::Mount $::tclKitFilename "/.KITDLL_USER" - lappend auto_path [file normalize "/.KITDLL_USER/lib"] + lappend auto_path "/.KITDLL_USER/lib" } } ## Mount the VFS from executable if {[info exists ::TCLKIT_INITVFS]} { catch { vfs::zip::Mount [info nameofexecutable] "/.KITDLL_APP" - lappend auto_path [file normalize "/.KITDLL_APP/lib"] + lappend auto_path "/.KITDLL_APP/lib" } } - } # Clean up unset -nocomplain ::zip::max_header_seek unset -nocomplain ::TCLKIT_TYPE ::TCLKIT_INITVFS unset -nocomplain ::TCLKIT_MOUNTPOINT ::TCLKIT_VFSSOURCE ::TCLKIT_MOUNTPOINT_VAR ::TCLKIT_VFSSOURCE_VAR unset -nocomplain ::tclKitStorage ::tclKitStorage_fd ::tclKitFilename unset -nocomplain ::tclkit_system_encoding }