Diff

Differences From Artifact [19424b6588]:

To Artifact [fcd5a93523]:


    10     10   	set mountpoint [file dirname [file normalize [file join $mountpoint __dummy__]]]
    11     11   
    12     12   	set tcl_library [file join $mountpoint lib tcl$tcl_version]
    13     13   	set tcl_libPath [list $tcl_library [file join $mountpoint lib]]
    14     14   
    15     15   	# the following code only gets executed once on startup
    16     16   	if {[info exists ::TCLKIT_INITVFS]} {
    17         -		catch {
    18         -			load {} vfs
    19         -		}
    20         -
    21     17   		# lookup and emulate "source" of lib/vfs/{vfs*.tcl,mk4vfs.tcl}
    22     18   		switch -- $::tclKitStorage {
    23     19   			"mk4" {
    24     20   				# must use raw MetaKit calls because VFS is not yet in place
    25     21   				set d [mk::select exe.dirs parent 0 name lib]
    26     22   				set d [mk::select exe.dirs parent $d name vfs]
    27     23       
................................................................................
   133    129   		# Resolve symlinks
   134    130   		set mountpoint [file dirname [file normalize [file join $mountpoint __dummy__]]]
   135    131   
   136    132   		set tcl_library [file join $mountpoint lib tcl$tcl_version]
   137    133   		set tcl_libPath [list $tcl_library [file join $mountpoint lib]]
   138    134   
   139    135   		vfs::filesystem mount $mountpoint $vfsHandler
          136  +
          137  +		# This loads everything needed for "clock scan" to work
          138  +		# "clock scan" is used within "vfs::zip", which may be
          139  +		# loaded before this is run causing the root VFS to break
          140  +		catch { clock scan }
   140    141   	}
   141    142     
   142    143   	# load config settings file if present
   143    144   	namespace eval ::vfs { variable tclkit_version 1 }
   144    145   	catch { uplevel #0 [list source [file join $mountpoint config.tcl]] }
   145    146   
   146    147   	# Perform expected initialization
   147    148   	uplevel #0 [list source [file join $tcl_library init.tcl]]
   148    149     
   149    150   	# reset auto_path, so that init.tcl's search outside of tclkit is cancelled
   150    151   	set auto_path $tcl_libPath
   151    152   
   152         -	# This loads everything needed for "clock scan" to work
   153         -	# "clock scan" is used within "vfs::zip", which may be
   154         -	# loaded before this is run causing the root VFS to break
   155         -	catch { clock scan }
   156         -
   157    153   	if {$::TCLKIT_TYPE == "kitdll"} {
   158    154   		# Set a maximum seek to avoid reading the entire file looking for a
   159    155   		# zip header
   160    156   		catch { 
   161    157   			package require vfs::zip
   162    158   			set ::zip::max_header_seek 8192
   163    159   		}
................................................................................
   164    160   
   165    161   		# Now that the initialization is complete, mount the user VFS if needed
   166    162   		## Mount the VFS from the Shared Object
   167    163   		if {[info exists ::TCLKIT_INITVFS] && [info exists ::tclKitFilename]} {
   168    164   			catch {
   169    165   				vfs::zip::Mount $::tclKitFilename "/.KITDLL_USER"
   170    166   
   171         -				lappend auto_path [file normalize "/.KITDLL_USER/lib"]
          167  +				lappend auto_path "/.KITDLL_USER/lib"
   172    168   			}
   173    169   		}
   174    170   
   175    171   		## Mount the VFS from executable
   176    172   		if {[info exists ::TCLKIT_INITVFS]} {
   177    173   			catch {
   178    174   				vfs::zip::Mount [info nameofexecutable] "/.KITDLL_APP"
   179    175   
   180         -				lappend auto_path [file normalize "/.KITDLL_APP/lib"]
          176  +				lappend auto_path "/.KITDLL_APP/lib"
   181    177   			}
   182    178   		}
   183         -
   184    179   	}
   185    180   
   186    181   	# Clean up
   187    182   	unset -nocomplain ::zip::max_header_seek
   188    183   	unset -nocomplain ::TCLKIT_TYPE ::TCLKIT_INITVFS
   189    184   	unset -nocomplain ::TCLKIT_MOUNTPOINT ::TCLKIT_VFSSOURCE ::TCLKIT_MOUNTPOINT_VAR ::TCLKIT_VFSSOURCE_VAR
   190    185   	unset -nocomplain ::tclKitStorage ::tclKitStorage_fd ::tclKitFilename
   191    186   	unset -nocomplain ::tclkit_system_encoding
   192    187   }