make.tcl modules + vfscommonupdate + bake ripple (native Tcl903 driver)
from the single-mechanism change-set ac19df2a: _vfscommon
punkboot/core.tcl regenerated from the 0.5.0 master; moduledoc::punkexe
0.5.0 -> 0.6.0 and moduledoc::punkboot 0.2.0 -> 0.3.0 version renames;
punk::mix templates modpod repacked carrying the layout _config sweep
(modpod-template copies + layout make.tcl copies via the established
sync channels). The same vfscommonupdate swept in promotions pending
from committed src work of the last sessions: commandstack 0.7.1,
punk::args 0.15.1, punk::auto_exec 0.1.1, punk::ns 0.9.2,
punk::tcltestrun 0.4.2, punk::zip 0.4.0.
Claude-Session: https://claude.ai/code/session_01Y1diJnhjUxKgEG6EwYAzxj
Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
set changed_unchanged [$vfs_eventtargetset_source_changes]
set vfs_or_runtime_changed [expr{[llength[dict get $changed_unchanged changed]]||[llength[$vfs_eventget_targets_exist]]<[llength[$vfs_eventget_targets]]}]
set vfs_or_runtime_changed [expr{$::punkboot::opt_force||[llength[dict get $changed_unchanged changed]]||[llength[$vfs_eventget_targets_exist]]<[llength[$vfs_eventget_targets]]}]
set changed_unchanged [$vfs_eventtargetset_source_changes]
set vfs_or_runtime_changed [expr{[llength[dict get $changed_unchanged changed]]||[llength[$vfs_eventget_targets_exist]]<[llength[$vfs_eventget_targets]]}]
set vfs_or_runtime_changed [expr{$::punkboot::opt_force||[llength[dict get $changed_unchanged changed]]||[llength[$vfs_eventget_targets_exist]]<[llength[$vfs_eventget_targets]]}]
set changed_unchanged [$vfs_eventtargetset_source_changes]
set vfs_or_runtime_changed [expr{[llength[dict get $changed_unchanged changed]]||[llength[$vfs_eventget_targets_exist]]<[llength[$vfs_eventget_targets]]}]
set vfs_or_runtime_changed [expr{$::punkboot::opt_force||[llength[dict get $changed_unchanged changed]]||[llength[$vfs_eventget_targets_exist]]<[llength[$vfs_eventget_targets]]}]
#[titledesc {args parsing}] [comment {-- Name section and table of contents description --}]
#[moddesc {args to nested dict of opts and values}] [comment {-- Description at end of page heading --}]
@ -69,6 +69,7 @@
#[para]The lines beginning with @ are usually optional in most cases and can be used to set defaults and some extra controls
#[para] - the above example would work just fine with only the -<optionname> lines, but would allow zero filenames to be supplied as no -min value is set for @values
#[para]valid @ directive lines begin with @id @cmd @form @leaders @opts @values @formdisplay @doc @examples (plus the bare directives @dynamic and @normalize)
#[para]A @values section may declare -flagvalues 1: unmatched dash-led words in option position are then consumed as trailing values instead of raising invalidoption (declared options still match first; the '--' end-of-options marker is unaffected). This makes forms such as a '--help' form robust to ignored trailing words of any shape.
#[para]lines beginning with a dash define options - a name can optionally be given to each trailing positional argument.
#[para]If no names are defined for positional arguments, they will end up in the values key of the dict with numerical keys starting at zero.
#[para]e.g the result from the punk::args::parse call above may be something like:
#-l (build a list of hash -p <path> <name> entries for all autoexec commands that can be used in a script to pre-populate the hash table without needing to call auto_execok for each command at runtime)
#---------------------
@form -form {help}
@opts -min 1 -max 1 -anyopts 1
@opts -min 1 -max 1
--help -type none -optional 0 -help\
"Display usage information for this command."
"Display usage information for this command.
Must be the first word after 'hash'; trailing words are
consumed as ignored values."
@values -min 0 -max -1
@values -min 0 -max -1 -flagvalues 1
ignored -type any -multiple 1 -optional 1 -help\
"Additional arguments that are ignored when --help is used"
"Additional arguments that are ignored when --help is used.
Dash-led words are consumed as values here (not treated
set dataStartOffset [tell $zf] ;#the overall file offset of the start of archive-data //JMN 2024
#G-165 write-path acceleration (mirrors the G-126 read-path seam in
#unzip): hand whole-tree archive WRITING to the vendored punkzip binary
#when this call is one it serves identically - directory-scan mode,
#archive-relative offsets, no -runtime/-zipkit prefix (prefix
#composition is the caller's concern, e.g assemble_zipcat_image),
#default whole-tree globs and an ascii comment. punk::zip's own walk
#above stays authoritative for the member set and the returned names
#(identical to the floor's, order included); punkzip's build re-walks
#with -b rooting at the same base and the same -x exclusion patterns
#(Tcl string match by entry name, both engines). The produced archive
#is read back and its member names compared against the walk result -
#any accelerator failure, unreadable output or mismatch deletes the
#file and falls back to the pure-Tcl writer silently.
#punk::zip::last_write_engine records which engine ran (tcl|accelerated)
#and punk::zip::last_write_note why the accelerator was skipped.
set accelerated 0
variable last_write_engine
variable last_write_note
set last_write_engine tcl
set last_write_note ""
if {$opts(-directory) ne "" && $opts(-offsettype) eq "archive"
&& $opts(-runtime) eq "" && !$opts(-zipkit)
&& [llength [dict get $argd values globs]] == 1
&& [lindex [dict get $argd values globs] 0] eq "*"
&& [string is ascii $opts(-comment)]} {
set acc [accelerator]
if {$acc eq ""} {
set last_write_note "no accelerator binary resolved (see punk::zip::accelerator)"
} else {
set acccmd [list $acc build]
if {$opts(-comment) ne ""} {
lappend acccmd -c $opts(-comment)
}
lappend acccmd -b $base
foreach pat $opts(-exclude) {
lappend acccmd -x $pat
}
lappend acccmd $filename $opts(-directory)
if {[catch {exec {*}$acccmd 2>@1} accout]} {
file delete -force $filename
set last_write_note "accelerator '$acc' failed - fell back to pure tcl: [string range $accout 0 300]"
} elseif {[catch {set accnames [lsort [lmap m [members $filename] {dict get $m name}]]} verr]} {
file delete -force $filename
set last_write_note "accelerator output unreadable - fell back to pure tcl: $verr"
} elseif {$accnames ne [lsort $paths]} {
file delete -force $filename
set last_write_note "accelerator member set mismatch - fell back to pure tcl"
} else {
set accelerated 1
}
}
} else {
set dataStartOffset 0 ;#offsets relative to file - the (old) zipfs mkzip way :/
set last_write_note "call not write-accelerator eligible (non-directory scan, -offsettype file, -runtime/-zipkit prefix, selective globs, or non-ascii comment) - pure tcl"