pkg::create(3tcl)
β¨ pkg::create β¨
okay bestie, welcome to the pkg::create page from the Tcl built-in commands manual π this one's short and sweet and honestly kinda iconic.
πΈ NAME πΈ
pkg::create β build a whole 'package ifneeded' command for a package spec you hand it. it's giving matchmaker for packages fr fr π
π¦ SYNOPSIS π¦
::pkg::create -name packageName -version packageVersion ?-load filespec?
... ?-source filespec? ...
π DESCRIPTION π
so ::pkg::create is a utility procedure, and it lives right in the standard Tcl library β she's part of the family π«Ά. her whole job is to create an appropriate package ifneeded command for a given package specification. that's it. that's the gig.
and why do we care? because you can use her to construct a pkgIndex.tcl file for use with the package mechanism. yes bestie, the actual package mechanism. main character energy β¨
π OPTIONS π
the parameters she supports are:
-namepackageName β this one sets the name of the package. it's required, no skipping, no cap π-versionpackageVersion β this one sets the version of the package. also required babe, both of them, always πΈ-loadfilespec β this one says "hey, here's a library that must be loaded with theloadcommand." andfilespecis a list with two elements:- the first element is the name of the file to load π
- the second element is optional, and it's a list of commands supplied by loading that file
- if that list of procedures is empty or just... not there, then
::pkg::createwill set up the library for direct loading (peeppkg_mkIndexfor the lore π) - you can throw in any number of
-loadparameters, go off β¨
-sourcefilespec β basically the same vibe as-load, except this one specifies a Tcl library that must be loaded with thesourcecommand instead. and yes, any number of-sourceparameters may be specified π
okay real talk though: at least one-loador-sourceparameter must be given. you can't just show up with a name and a version and nothing else, that's not the move π
π₯ SEE ALSO π₯
π KEYWORDS π
auto-load, index, package, version
and that's the whole page bestie, short king behavior but she gets the job done π β¨
this was the Tcl 8.3 era of the manual, page pkg::create(3tcl) β mwah, sending you off with a π and a π¦, go build that pkgIndex.tcl iykyk π
π¦ where this page comes from
- debian trixie: tcl9.0-doc 9.0.1+dfsg-2
- ubuntu questing: tcl9.0-doc 9.0.2+dfsg-1
- ubuntu resolute: tcl9.0-doc 9.0.3+dfsg-1
- ubuntu stonking: tcl9.0-doc 9.0.4+dfsg-1
- Copyright (c) 1998-2000 Scriptics Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms