Index: kitsh/buildsrc/kitsh-0.0/boot.tcl ================================================================== --- kitsh/buildsrc/kitsh-0.0/boot.tcl +++ kitsh/buildsrc/kitsh-0.0/boot.tcl @@ -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 } Index: kitsh/buildsrc/kitsh-0.0/kitInit.c ================================================================== --- kitsh/buildsrc/kitsh-0.0/kitInit.c +++ kitsh/buildsrc/kitsh-0.0/kitInit.c @@ -135,10 +135,11 @@ "return -code $code $res\n" "}\n" #endif /* _WIN32_WCE && !TCLKIT_DLL */ "proc tclKitInit {} {\n" "rename tclKitInit {}\n" + "catch { load {} vfs }\n" #ifdef KIT_INCLUDES_ZLIB "catch { load {} zlib }\n" #endif #ifdef KIT_INCLUDES_MK4TCL "catch { load {} Mk4tcl }\n" @@ -153,10 +154,12 @@ "catch {\n" "set f [open $bootfile]\n" "set s [read $f]\n" "close $f\n" "}\n" + "} else {\n" + "set ::TCLKIT_INITVFS 1\n" "}\n" #ifdef KIT_STORAGE_MK4 "set ::tclKitStorage \"mk4\"\n" "if {![info exists s]} {\n" "mk::file open exe " TCLKIT_VFSSOURCE " -readonly\n" @@ -171,11 +174,10 @@ "}\n" "}\n" #endif /* KIT_STORAGE_MK4 */ #ifdef KIT_STORAGE_ZIP "set ::tclKitStorage \"zip\"\n" - "catch { load {} vfs }\n" "if {![info exists s]} {\n" # include "zipvfs.tcl.h" "catch {\n" "set ::tclKitStorage_fd [::zip::open " TCLKIT_VFSSOURCE "]\n" "::zip::stat $::tclKitStorage_fd boot.tcl sb\n" @@ -185,11 +187,10 @@ "}\n" #endif /* KIT_STORAGE_ZIP */ #ifdef KIT_STORAGE_CVFS "set ::tclKitStorage \"cvfs\"\n" "load {} rechan\n" - "load {} vfs\n" "load {} cvfs_data_tcl\n" #include "cvfs.tcl.h" "if {![info exists s]} {\n" "catch {\n" "set s [::vfs::cvfs::data::getData tcl boot.tcl]\n" @@ -384,11 +385,10 @@ Tcl_SetVar(interp, "tcl_rcFileName", "~/tclkitrc.tcl", TCL_GLOBAL_ONLY); # else Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclkitrc", TCL_GLOBAL_ONLY); # endif /* _WIN32 */ #endif /* !TCLKIT_DLL */ - Tcl_SetVar(interp, "TCLKIT_INITVFS", "1", TCL_GLOBAL_ONLY); #ifdef TCLKIT_CAN_SET_ENCODING /* Set the encoding from the Environment */ Tcl_GetEncodingNameFromEnvironment(&encodingName); Tcl_SetSystemEncoding(NULL, Tcl_DStringValue(&encodingName));