Diff

Differences From Artifact [22b7e78c5d]:

To Artifact [a3240f621e]:


    17     17   
    18     18     # the following code only gets executed once on startup
    19     19     if {[info exists tcl_rcFileName]} {
    20     20       load {} vfs
    21     21   
    22     22       # lookup and emulate "source" of lib/vfs/{vfs*.tcl,mk4vfs.tcl}
    23     23       # must use raw MetaKit calls because VFS is not yet in place
    24         -    set d [mk::select exe.dirs parent 0 name lib]
    25         -    set d [mk::select exe.dirs parent $d name vfs]
           24  +    set d [${::tclkitMkNamespace}::select exe.dirs parent 0 name lib]
           25  +    set d [${::tclkitMkNamespace}::select exe.dirs parent $d name vfs]
    26     26       
    27     27       foreach x {vfsUtils vfslib mk4vfs} {
    28         -      set n [mk::select exe.dirs!$d.files name $x.tcl]
    29         -      set s [mk::get exe.dirs!$d.files!$n contents]
           28  +      set n [${::tclkitMkNamespace}::select exe.dirs!$d.files name $x.tcl]
           29  +      set s [${::tclkitMkNamespace}::get exe.dirs!$d.files!$n contents]
    30     30         catch {set s [zlib decompress $s]}
    31     31         uplevel #0 $s
    32     32       }
    33     33   
    34     34       # use on-the-fly decompression, if mk4vfs understands that
    35         -    set mk4vfs::zstreamed 1
           35  +    switch -- $::tclkitMkNamespace {
           36  +        "mk" {
           37  +            set mk4vfs::zstreamed 1
           38  +            set vfsimpl "mk4"
           39  +        }
           40  +        "readkit" {
           41  +            set mkcl_vfs::zstreamed 1
           42  +            set vfsimpl "mkcl"
           43  +        }
           44  +    }
    36     45   
    37     46       # mount the executable, i.e. make all runtime files available
    38         -    vfs::filesystem mount $noe [list ::vfs::mk4::handler exe]
           47  +    vfs::filesystem mount $noe [list ::vfs::${vfsimpl}::handler exe]
    39     48   
    40     49       # alter path to find encodings
    41     50       if {[info tclversion] eq "8.4"} {
    42     51         load {} pwb
    43     52         librarypath [info library]
    44     53       } else {
    45     54         encoding dirs [list [file join [info library] encoding]] ;# TIP 258
................................................................................
    61     70       set noe [info nameofexecutable]
    62     71   
    63     72     	# Resolve symlinks
    64     73     	set noe [file dirname [file normalize [file join $noe __dummy__]]]
    65     74   
    66     75       set tcl_library [file join $noe lib tcl$tcl_version]
    67     76       set tcl_libPath [list $tcl_library [file join $noe lib]]
    68         -    vfs::filesystem mount $noe [list ::vfs::mk4::handler exe]
           77  +    vfs::filesystem mount $noe [list ::vfs::${vfsimpl}::handler exe]
    69     78     }
    70     79     
    71     80     # load config settings file if present
    72     81     namespace eval ::vfs { variable tclkit_version 1 }
    73     82     catch { uplevel #0 [list source [file join $noe config.tcl]] }
    74     83   
    75     84     uplevel #0 [list source [file join $tcl_library init.tcl]]
    76     85     
    77     86   # reset auto_path, so that init.tcl's search outside of tclkit is cancelled
    78     87     set auto_path $tcl_libPath
           88  +
           89  +  unset ::tclkitMkNamespace
    79     90   }