[Starkit] possible sdx enhancements - create + fill
Steve Landers
steve at DigitalSmarties.com
Mon Jan 24 21:36:27 CET 2005
Folks,
I've thrown together a couple of additional scripts for sdx - to
automate some tasks I seem to be doing manually quite often.
The first is "sdx create" - it creates the .vfs hierarchy if one
doesn't exist (much like "sdx qwrap" then "sdx unwrap", except it
doesn't create a .kit).
But on platforms that support symbolic linking, instead of copying the
whatever.tcl script into whatever.vfs/lib/app-whatever/whatever.tcl, it
creates a symbolic link. This matches the way I work on Linux - the
real source file sitting next to whatever.vfs and a symbolic link to it
from within the .vfs hierarchy.
This approach also means that a "package provide app-whatever" will be
added to the whatever.tcl in the current directory - so "sdx create"
first renames whatever.tcl to whatever.tcl.orig and then copies that
back to whatever.tcl (whew!)
The second script is "sdx fill". This tries to add any dependent
packages to the whatever.vfs/lib directory by looking for a
corresponding starkit in the users PATH (using auto_execok).
On my system, I keep a copy of various library starkits in
/usr/local/bin (e.g. oomk.kit, csv.kit, tktable.kit, etc.). If any of
these are "package require"d in whatever.tcl, then "sdx fill" will find
these using auto_execok and will copy the contents of their .vfs/lib
directory into whatever.vfs/lib. When looking for the package name it
tries lowercase and also [lindex [split $pkg :] 0] (e.g. style::as).
For example, ...
$ cat blah.tcl
package require oomk
package require Tk
package require Tktable
package require busy
package require csv
package require style::as
$ sdx create blah
created blah.vfs
renamed blah.tcl to blah.tcl.orig
added "package provide" to blah.tcl
blah.tcl linked to blah.vfs/lib/app-blah/blah.tcl
$ sdx fill blah
added oomk package
added snit package
added tktable package
added busy package
added csv package
added style package
$ tree blah.fs
blah.vfs
|-- lib
| |-- app-blah
| | |-- blah.tcl -> /Users/steve/Work/sdx/blah.tcl
| | `-- pkgIndex.tcl
| |-- busy
| | |-- AIX-ppc
| | | |-- busy.so
| | | `-- critcl.tcl
| | |-- Darwin-ppc
| | | |-- busy.dylib
| | | `-- critcl.tcl
| | |-- Linux-x86
| | | |-- busy.so
| | | `-- critcl.tcl
| | |-- SunOS-sparc
| | | |-- busy.so
| | | `-- critcl.tcl
| | |-- Tcl
| | | `-- busy.tcl
| | |-- Windows-x86
| | | |-- busy.dll
| | | `-- critcl.tcl
| | |-- critcl.tcl
| | `-- pkgIndex.tcl
| |-- csv
| | |-- csv.tcl
| | `-- pkgIndex.tcl
| |-- oomk
| | |-- oomk.tcl
| | `-- pkgIndex.tcl
| |-- snit
| | |-- license.txt
| | |-- pkgIndex.tcl
| | `-- snit.tcl
| |-- style
| | |-- as.tcl
| | |-- lobster.tcl
| | |-- pkgIndex.tcl
| | `-- style.tcl
| `-- tktable
| |-- Darwin-ppc
| | `-- tktable.dylib
| |-- Linux-x86
| | `-- tktable.so
| |-- pkgIndex.tcl
| `-- tkTable.tcl
`-- main.tcl
"sdx fill" isn't a replacement for a proper repository, but I find it a
useful automation tool.
What do others think?
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: create.tcl
Type: application/octet-stream
Size: 2770 bytes
Desc: not available
Url : http://www.equi4.com/pipermail/starkit/attachments/20050124/7ac72844/create.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fill.tcl
Type: application/octet-stream
Size: 2429 bytes
Desc: not available
Url : http://www.equi4.com/pipermail/starkit/attachments/20050124/7ac72844/fill.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: help.tcl
Type: application/octet-stream
Size: 8965 bytes
Desc: not available
Url : http://www.equi4.com/pipermail/starkit/attachments/20050124/7ac72844/help.obj
-------------- next part --------------
More information about the Starkit
mailing list