Index: kitsh/build.sh ================================================================== --- kitsh/build.sh +++ kitsh/build.sh @@ -49,16 +49,15 @@ ## Install using existing Tclkit ### Call installer tclkit installvfs.tcl kit starpack.vfs else ## Bootstrap (cannot cross-compile) - ### Copy installed data for packages - mkdir "installed-pkgs" - cp -r "${OTHERPKGSDIR}"/*/inst/* 'installed-pkgs/' - ### Call installer - ${TCLCONFIGDIR}/tclsh installvfs.tcl kit starpack.vfs + cp kit runkit + echo 'set argv [list kit starpack.vfs]' > setup.tcl + echo 'source installvfs.tcl' >> setup.tcl + echo | ./runkit fi ) || exit 1 exit 0 Index: kitsh/buildsrc/kitsh-0.0/installvfs.tcl ================================================================== --- kitsh/buildsrc/kitsh-0.0/installvfs.tcl +++ kitsh/buildsrc/kitsh-0.0/installvfs.tcl @@ -1,33 +1,44 @@ #! /usr/bin/env tclsh -lappend auto_path [file join installed-pkgs lib] -package require vfs::mk4 - if {[llength $argv] != 2} { puts stderr "Usage: installvfs.tcl " exit 1 } + +set kitfile [lindex $argv 0] +set vfsdir [lindex $argv 1] + +if {[catch { + package require vfs::mk4 +}]} { + catch { + load "" vfs + load "" Mk4tcl + + source [file join $vfsdir lib/vfs/vfsUtils.tcl] + source [file join $vfsdir lib/vfs/vfslib.tcl] + source [file join $vfsdir lib/vfs/mk4vfs.tcl] + } +} proc copy_file {srcfile destfile} { switch -glob -- $srcfile { - "*.tcl" { + "*.tcl" - "*.txt" { set ifd [open $srcfile r] set ofd [open $destfile w] - fcopy $ifd $ofd + set ret [fcopy $ifd $ofd] close $ofd close $ifd } default { file copy -- $srcfile $destfile } } - - puts "Copied $srcfile to $destfile" } proc recursive_copy {srcdir destdir} { foreach file [glob -nocomplain -directory $srcdir *] { set filetail [file tail $file] @@ -47,13 +58,10 @@ puts stderr "Failed to copy: $file: $err" } } } -set kitfile [lindex $argv 0] -set vfsdir [lindex $argv 1] - -set handle [vfs::mk4::Mount $kitfile /kit] +set handle [vfs::mk4::Mount $kitfile /kit -nocommit] recursive_copy $vfsdir /kit -vfs::mk4::Unmount $handle /kit +vfs::unmount /kit