Browse Source
Fresh clone (shallow path + core.longpaths - the deep-path first attempt hit windows MAX_PATH on the modpod template trees, caveat recorded) -> the clone's own punk-getzig fetched 0.16.0 (mirror chain, minisign, versioned dir) -> cold-cache suite build PASS: 9.0.5 static/zip/pr/przip shells with recipe-generated configure-products, zip shell smoked, all tk/tklib/tcllib/tcllibc legs green. Cold-log 'failed command:' blocks diagnosed as BENIGN zig 0.16 behaviour (build_runner prints that block for any step with nonempty result_stderr even on success) triggered by our own tools' informational stderr prints - zipfs_mkzip/mkimg call echoes now go to stdout and wrapfiletofile's octet count is removed; rebuild shows zero occurrences, PASS. All G-096 acceptance items are now met - achieved flip pending user confirmation. Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.commaster
4 changed files with 153 additions and 119 deletions
@ -1,55 +1,58 @@
|
||||
#JMN 2024 |
||||
#A simple wrapper to call the 'zipfs mkimg' (tcl::zipfs::mkimg) command via commandline arguments. |
||||
#(avoiding piping commands to tclsh via stdin to make calling simpler, and to provide more specific error messages) |
||||
# |
||||
set script_title "[file tail [info nameofexecutable]] [file tail [info script]]" |
||||
set usage "$script_title -outfile <target_zipfile_path> -indir <folder_to_zip> ?-strip <path_prefix_to_strip>? ?-password <plaintext>? ?-infile <explicit_prepend_file>?" |
||||
set arglist $::argv |
||||
puts stderr "====> '$arglist'" |
||||
#error 42 |
||||
if {![llength $arglist]} { |
||||
puts stderr $usage |
||||
exit 1 |
||||
} |
||||
if {[llength $arglist] %2 != 0} { |
||||
puts stderr "$script_title error: expected an even number of option value pairs. Got [llength $arglist] commandline arguments. '$arglist'" |
||||
puts stderr $usage |
||||
exit 2 |
||||
} |
||||
set known_opts [list -outfile -indir -strip -password -infile] |
||||
dict for {k v} $arglist { |
||||
switch -exact -- $k { |
||||
-outfile - -indir - -strip - -password - -infile {} |
||||
default { |
||||
puts stderr "$script_title error: unrecognised option $k. Known_options $known_opts" |
||||
exit 3 |
||||
} |
||||
} |
||||
} |
||||
set defaults [dict create\ |
||||
-strip ""\ |
||||
-password ""\ |
||||
] |
||||
|
||||
set opts [dict merge $defaults $arglist] |
||||
if {![dict exists $opts -outfile]} { |
||||
puts stderr "$script_title error: Missing -outfile <zipfilename>" |
||||
exit 4 |
||||
} |
||||
if {![dict exists $opts -indir]} { |
||||
puts stderr "$script_title error: Missing -indir <folder>" |
||||
exit 5 |
||||
} |
||||
set callargs [list [file normalize [dict get $opts -outfile]] [file normalize [dict get $opts -indir]] [file normalize [dict get $opts -strip]] [dict get $opts -password]] |
||||
if {[dict exists $opts -infile]} { |
||||
lappend callargs [file normalize [dict get $opts -infile]] |
||||
} |
||||
puts stderr "$script_title call 'tcl::zipfs::mkimg $callargs'" |
||||
|
||||
if {[catch { |
||||
tcl::zipfs::mkimg {*}$callargs |
||||
} errM]} { |
||||
puts stderr "$script_title error: Failure during call 'tcl::zipfs::mkimg $callargs'\n $errM" |
||||
exit 6 |
||||
} |
||||
#JMN 2024 |
||||
#A simple wrapper to call the 'zipfs mkimg' (tcl::zipfs::mkimg) command via commandline arguments. |
||||
#(avoiding piping commands to tclsh via stdin to make calling simpler, and to provide more specific error messages) |
||||
# |
||||
set script_title "[file tail [info nameofexecutable]] [file tail [info script]]" |
||||
set usage "$script_title -outfile <target_zipfile_path> -indir <folder_to_zip> ?-strip <path_prefix_to_strip>? ?-password <plaintext>? ?-infile <explicit_prepend_file>?" |
||||
set arglist $::argv |
||||
#informational arglist echo goes to stdout if wanted - stderr output makes zig build |
||||
#report the (successful) step with a misleading "failed command:" block (0.16 |
||||
#build_runner prints that whenever result_stderr is nonempty, success or not) |
||||
puts stdout "====> '$arglist'" |
||||
#error 42 |
||||
if {![llength $arglist]} { |
||||
puts stderr $usage |
||||
exit 1 |
||||
} |
||||
if {[llength $arglist] %2 != 0} { |
||||
puts stderr "$script_title error: expected an even number of option value pairs. Got [llength $arglist] commandline arguments. '$arglist'" |
||||
puts stderr $usage |
||||
exit 2 |
||||
} |
||||
set known_opts [list -outfile -indir -strip -password -infile] |
||||
dict for {k v} $arglist { |
||||
switch -exact -- $k { |
||||
-outfile - -indir - -strip - -password - -infile {} |
||||
default { |
||||
puts stderr "$script_title error: unrecognised option $k. Known_options $known_opts" |
||||
exit 3 |
||||
} |
||||
} |
||||
} |
||||
set defaults [dict create\ |
||||
-strip ""\ |
||||
-password ""\ |
||||
] |
||||
|
||||
set opts [dict merge $defaults $arglist] |
||||
if {![dict exists $opts -outfile]} { |
||||
puts stderr "$script_title error: Missing -outfile <zipfilename>" |
||||
exit 4 |
||||
} |
||||
if {![dict exists $opts -indir]} { |
||||
puts stderr "$script_title error: Missing -indir <folder>" |
||||
exit 5 |
||||
} |
||||
set callargs [list [file normalize [dict get $opts -outfile]] [file normalize [dict get $opts -indir]] [file normalize [dict get $opts -strip]] [dict get $opts -password]] |
||||
if {[dict exists $opts -infile]} { |
||||
lappend callargs [file normalize [dict get $opts -infile]] |
||||
} |
||||
puts stdout "$script_title call 'tcl::zipfs::mkimg $callargs'" ;#stdout: stderr makes zig report the successful step as 'failed command' |
||||
|
||||
if {[catch { |
||||
tcl::zipfs::mkimg {*}$callargs |
||||
} errM]} { |
||||
puts stderr "$script_title error: Failure during call 'tcl::zipfs::mkimg $callargs'\n $errM" |
||||
exit 6 |
||||
} |
||||
exit 0 |
||||
@ -1,65 +1,65 @@
|
||||
#JMN 2024 |
||||
#A simple wrapper to call the 'zipfs mkzip' (tcl::zipfs::mkzip) command via commandline arguments. |
||||
#(avoiding piping commands to tclsh via stdin to make calling simpler, and to provide more specific error messages) |
||||
# |
||||
set script_title "[file tail [info nameofexecutable]] [file tail [info script]]" |
||||
set usage "$script_title -outfile <target_zipfile_path> -indir <folder_to_zip> ?-strip <path_prefix_to_strip>? ?-password <plaintext>?" |
||||
set arglist $::argv |
||||
#puts stderr "====> '$arglist'" |
||||
#error 42 |
||||
if {![llength $arglist]} { |
||||
puts stderr $usage |
||||
exit 1 |
||||
} |
||||
if {[llength $arglist] %2 != 0} { |
||||
puts stderr "$script_title error: expected an even number of option value pairs. Got [llength $arglist] commandline arguments. '$arglist'" |
||||
puts stderr $usage |
||||
exit 2 |
||||
} |
||||
set known_opts [list -outfile -indir -strip -password] |
||||
dict for {k v} $arglist { |
||||
switch -exact -- $k { |
||||
-outfile - -indir - -strip - -password {} |
||||
default { |
||||
puts stderr "$script_title error: unrecognised option $k. Known_options $known_opts" |
||||
exit 3 |
||||
} |
||||
} |
||||
} |
||||
set defaults [dict create\ |
||||
] |
||||
|
||||
set opts [dict merge $defaults $arglist] |
||||
if {![dict exists $opts -outfile]} { |
||||
puts stderr "$script_title error: Missing -outfile <zipfilename>" |
||||
exit 4 |
||||
} |
||||
if {![dict exists $opts -indir]} { |
||||
puts stderr "$script_title error: Missing -indir <folder>" |
||||
exit 5 |
||||
} |
||||
set callargs [list [file normalize [dict get $opts -outfile]] [file normalize [dict get $opts -indir]]] |
||||
if {[dict exists $opts -strip]} { |
||||
set opt_strip [dict get $opts -strip] |
||||
#avoid extraneous underscore(empty path segment?) in zip archive on windows. |
||||
#review - test if trailing slash needed on other platforms |
||||
#if {"windows" eq "$::tcl_platform(platform)" && $opt_strip ne "" && [lindex $opt_strip end] ne "\\"} { |
||||
# append opt_strip \\ |
||||
#} |
||||
lappend callargs [file normalize $opt_strip] |
||||
} |
||||
if {[dict exists $opts -password]} { |
||||
if {![dict exists $opts -strip]} { |
||||
lappend callargs "" |
||||
} |
||||
lappend callargs [dict get $opts -password] |
||||
} |
||||
puts stderr "$script_title call 'tcl::zipfs::mkzip $callargs'" |
||||
|
||||
if {[catch { |
||||
tcl::zipfs::mkzip {*}$callargs |
||||
} errM]} { |
||||
puts stderr "$script_title error: Failure during call 'tcl::zipfs::mkzip $callargs'\n $errM" |
||||
exit 6 |
||||
} |
||||
#JMN 2024 |
||||
#A simple wrapper to call the 'zipfs mkzip' (tcl::zipfs::mkzip) command via commandline arguments. |
||||
#(avoiding piping commands to tclsh via stdin to make calling simpler, and to provide more specific error messages) |
||||
# |
||||
set script_title "[file tail [info nameofexecutable]] [file tail [info script]]" |
||||
set usage "$script_title -outfile <target_zipfile_path> -indir <folder_to_zip> ?-strip <path_prefix_to_strip>? ?-password <plaintext>?" |
||||
set arglist $::argv |
||||
#puts stderr "====> '$arglist'" |
||||
#error 42 |
||||
if {![llength $arglist]} { |
||||
puts stderr $usage |
||||
exit 1 |
||||
} |
||||
if {[llength $arglist] %2 != 0} { |
||||
puts stderr "$script_title error: expected an even number of option value pairs. Got [llength $arglist] commandline arguments. '$arglist'" |
||||
puts stderr $usage |
||||
exit 2 |
||||
} |
||||
set known_opts [list -outfile -indir -strip -password] |
||||
dict for {k v} $arglist { |
||||
switch -exact -- $k { |
||||
-outfile - -indir - -strip - -password {} |
||||
default { |
||||
puts stderr "$script_title error: unrecognised option $k. Known_options $known_opts" |
||||
exit 3 |
||||
} |
||||
} |
||||
} |
||||
set defaults [dict create\ |
||||
] |
||||
|
||||
set opts [dict merge $defaults $arglist] |
||||
if {![dict exists $opts -outfile]} { |
||||
puts stderr "$script_title error: Missing -outfile <zipfilename>" |
||||
exit 4 |
||||
} |
||||
if {![dict exists $opts -indir]} { |
||||
puts stderr "$script_title error: Missing -indir <folder>" |
||||
exit 5 |
||||
} |
||||
set callargs [list [file normalize [dict get $opts -outfile]] [file normalize [dict get $opts -indir]]] |
||||
if {[dict exists $opts -strip]} { |
||||
set opt_strip [dict get $opts -strip] |
||||
#avoid extraneous underscore(empty path segment?) in zip archive on windows. |
||||
#review - test if trailing slash needed on other platforms |
||||
#if {"windows" eq "$::tcl_platform(platform)" && $opt_strip ne "" && [lindex $opt_strip end] ne "\\"} { |
||||
# append opt_strip \\ |
||||
#} |
||||
lappend callargs [file normalize $opt_strip] |
||||
} |
||||
if {[dict exists $opts -password]} { |
||||
if {![dict exists $opts -strip]} { |
||||
lappend callargs "" |
||||
} |
||||
lappend callargs [dict get $opts -password] |
||||
} |
||||
puts stdout "$script_title call 'tcl::zipfs::mkzip $callargs'" ;#stdout: stderr makes zig report the successful step as 'failed command' |
||||
|
||||
if {[catch { |
||||
tcl::zipfs::mkzip {*}$callargs |
||||
} errM]} { |
||||
puts stderr "$script_title error: Failure during call 'tcl::zipfs::mkzip $callargs'\n $errM" |
||||
exit 6 |
||||
} |
||||
exit 0 |
||||
Loading…
Reference in new issue