From: Jean-Claude Wippler Date: Tue, 21 Oct 2003 09:25:17 +0000 (+0000) Subject: starkit::mode added X-Git-Tag: vfs-1-4~110 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=d16f2b74d897ccac02ce939b37a4ed04eb233598;p=tclvfs starkit::mode added --- diff --git a/ChangeLog b/ChangeLog index 31437bb..459ed33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-10-21 Jean-Claude Wippler + + * starkit.tcl: add starkit::mode variable, which remembers the + return value of starkit::startup (suggestion by Andreas Kupries) + * pkgIndex.tcl: bumped starkit version from 1.2 to 1.3 + + * ChangeLog: cleaned up a few tab-vs-space indentations + 2003-10-17 Vince Darley * generic/vfs.c: removed some compiler warnings on OS X. @@ -49,7 +57,7 @@ * tests/vfsZip.test: * tests/vfsTar.test: added some new tests for recently fixed bugs. - * library/tarvfs.tcl: fix to bug when closing an empty archive. + * library/tarvfs.tcl: fix to bug when closing an empty archive. Also updated package to version 1.2.1 since a variety of bugs have been fixed since the 1.2 release @@ -209,9 +217,9 @@ 2003-02-18 Vince Darley * generic/vfs.c: - * library/*.tcl: clean up of posix error handling. + * library/*.tcl: clean up of posix error handling. - * doc/vfs.n: added some more documentation. + * doc/vfs.n: added some more documentation. 2003-02-18 Vince Darley @@ -338,7 +346,7 @@ * DESCRIPTION.txt: * make55.tcl: new files for TIP55 compliance. (Steve Cassidy) - * tests/*: + * tests/*: * doc/tcllib.n: updated tests and docs for the above 'package' information. @@ -566,7 +574,7 @@ * doc/vfslib.n: some documentation on the 'library' code. 2001-10-29 Vince Darley - * win/makefile.vc: installation is better. + * win/makefile.vc: installation is better. * library/vfsUrl.tcl: improved urltype mounting. The following will now work in all cases: % vfs::urltype::Mount ftp diff --git a/library/pkgIndex.tcl b/library/pkgIndex.tcl index 9e3dd5f..0abc57f 100644 --- a/library/pkgIndex.tcl +++ b/library/pkgIndex.tcl @@ -39,7 +39,7 @@ proc loadvfs {dll} { } package ifneeded vfs 1.3.0 [list loadvfs $dll] -package ifneeded starkit 1.2 [list source [file join $dir starkit.tcl]] +package ifneeded starkit 1.3 [list source [file join $dir starkit.tcl]] package ifneeded vfslib 1.3.1 [list source [file join $dir vfslib.tcl]] # Old diff --git a/library/starkit.tcl b/library/starkit.tcl index 1f9fa34..9536a30 100644 --- a/library/starkit.tcl +++ b/library/starkit.tcl @@ -1,7 +1,7 @@ # Starkit support, see http://www.equi4.com/starkit/ # by Jean-Claude Wippler, July 2002 -package provide starkit 1.2 +package provide starkit 1.3 # Starkit scripts can launched in a number of ways: # - wrapped or unwrapped @@ -26,6 +26,12 @@ if {![info exists auto_index(lassign)] && [info commands lassign] eq ""} { } namespace eval starkit { + # these variables are defined after the call to starkit::startup + # they are special in that a second call will not alter them + # (as needed when a starkit sources others for more packages) + variable topdir ;# root directory (while the starkit is mounted) + variable mode ;# startup mode (starkit, sourced, etc) + # called from the header of a starkit proc header {driver args} { if {[catch { @@ -41,15 +47,19 @@ namespace eval starkit { } # called from the startup script of a starkit to init topdir and auto_path + # 2003/10/21, added in 1.3: remember startup mode in starkit::mode + proc startup {} { + if {![info exists starkit::mode]} { variable mode } + set mode [_startup] + } + # returns how the script was launched: starkit, starpack, unwrapped, or # sourced (2003: also tclhttpd, plugin, or service) - proc startup {} { + proc _startup {} { global argv0 # 2003/02/11: new behavior, if starkit::topdir exists, don't disturb it - if {![info exists starkit::topdir]} { - variable topdir ;# the root directory (while the starkit is mounted) - } + if {![info exists starkit::topdir]} { variable topdir } set script [file normalize [info script]] set topdir [file dirname $script]