Browse Source

fix shellfilter tee_to_log

master
Julian Noble 3 weeks ago
parent
commit
5297ce3362
  1. 2
      src/bootsupport/modules/punk/args-0.2.1.tm
  2. 41
      src/bootsupport/modules/shellfilter-0.2.1.tm
  3. 2
      src/modules/punk/args-999999.0a1.0.tm
  4. 3348
      src/modules/shellfilter-999999.0a1.0.tm
  5. 3
      src/modules/shellfilter-buildversion.txt
  6. 2
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/args-0.2.1.tm
  7. 3348
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/shellfilter-0.2.1.tm
  8. 2
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/args-0.2.1.tm
  9. 3348
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/shellfilter-0.2.1.tm
  10. 2
      src/vfs/_vfscommon.vfs/modules/punk/args-0.2.1.tm
  11. 3
      src/vfs/_vfscommon.vfs/modules/punk/mix-0.2.1.tm
  12. 3348
      src/vfs/_vfscommon.vfs/modules/shellfilter-0.2.1.tm

2
src/bootsupport/modules/punk/args-0.2.1.tm

@ -11069,8 +11069,8 @@ tcl::namespace::eval punk::args::argdocbase {
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ # ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
tcl::namespace::eval punk::args::package { tcl::namespace::eval punk::args::package {
variable PUNKARGS variable PUNKARGS
# @dynamic not required?
lappend PUNKARGS [list { lappend PUNKARGS [list {
@dynamic
@id -id "::punk::args::package::standard_about" @id -id "::punk::args::package::standard_about"
@cmd -name "%pkg%::about" -help\ @cmd -name "%pkg%::about" -help\
"About %pkg% "About %pkg%

41
src/modules/shellfilter-0.2.tm → src/bootsupport/modules/shellfilter-0.2.1.tm

@ -76,6 +76,7 @@ tcl::namespace::eval shellfilter::log {
if {![string length $is_open_required]} { if {![string length $is_open_required]} {
return $allow_adhoc_tags return $allow_adhoc_tags
} else { } else {
#why not use string is boolean?
set truevalues [list y yes true 1] set truevalues [list y yes true 1]
set falsevalues [list n no false 0] set falsevalues [list n no false 0]
if {[string tolower $is_open_required] in $truevalues} { if {[string tolower $is_open_required] in $truevalues} {
@ -415,14 +416,14 @@ namespace eval shellfilter::chan {
set inputbytes $o_encbuf$bytes set inputbytes $o_encbuf$bytes
set o_encbuf "" set o_encbuf ""
set tail_offset 0 set tail_offset 0
while {$tail_offset < [string length $inputbytes] && [catch {tcl::encoding::convertfrom $o_enc [string range $inputbytes 0 end-$tail_offset]} stringdata]} { while {$tail_offset < [::tcl::string::length $inputbytes] && [catch {tcl::encoding::convertfrom $o_enc [::tcl::string::range $inputbytes 0 end-$tail_offset]} stringdata]} {
incr tail_offset incr tail_offset
} }
if {$tail_offset > 0} { if {$tail_offset > 0} {
if {$tail_offset < [string length $inputbytes]} { if {$tail_offset < [::tcl::string::length $inputbytes]} {
#stringdata from catch statement must be a valid result #stringdata from catch statement must be a valid result
set t [expr {$tail_offset - 1}] set t [expr {$tail_offset - 1}]
set o_encbuf [string range $inputbytes end-$t end] set o_encbuf [::tcl::string::range $inputbytes end-$t end]
} else { } else {
set stringdata "" set stringdata ""
set o_encbuf $inputbytes set o_encbuf $inputbytes
@ -432,7 +433,7 @@ namespace eval shellfilter::chan {
#::shellfilter::log::write $o_logsource $logdata #::shellfilter::log::write $o_logsource $logdata
puts -nonewline $o_localchan $stringdata puts -nonewline $o_localchan $stringdata
#return $bytes #return $bytes
return [string range $inputbytes 0 end-$tail_offset] return [::tcl::string::range $inputbytes 0 end-$tail_offset]
} }
#a tee is not a redirection - because data still flows along the main path #a tee is not a redirection - because data still flows along the main path
method meta_is_redirection {} { method meta_is_redirection {} {
@ -490,23 +491,23 @@ namespace eval shellfilter::chan {
set inputbytes $o_encbuf$bytes set inputbytes $o_encbuf$bytes
set o_encbuf "" set o_encbuf ""
set tail_offset 0 set tail_offset 0
while {$tail_offset < [string length $inputbytes] && [catch {tcl::encoding::convertfrom $o_enc [string range $inputbytes 0 end-$tail_offset]} stringdata]} { while {$tail_offset < [::tcl::string::length $inputbytes] && [catch {tcl::encoding::convertfrom $o_enc [::tcl::string::range $inputbytes 0 end-$tail_offset]} stringdata]} {
incr tail_offset incr tail_offset
} }
if {$tail_offset > 0} { if {$tail_offset > 0} {
if {$tail_offset < [string length $inputbytes]} { if {$tail_offset < [::tcl::string::length $inputbytes]} {
#stringdata from catch statement must be a valid result #stringdata from catch statement must be a valid result
set t [expr {$tail_offset - 1}] set t [expr {$tail_offset - 1}]
set o_encbuf [string range $inputbytes end-$t end] set o_encbuf [::tcl::string::range $inputbytes end-$t end]
} else { } else {
set stringdata "" set stringdata ""
set o_encbuf $inputbytes set o_encbuf $inputbytes
return "" return ""
} }
} }
::shellfilter::log::write $o_logsource $logdata set bytes [::tcl::string::range $inputbytes 0 end-$tail_offset]
#return $bytes ::shellfilter::log::write $o_logsource $stringdata
return [string range $inputbytes 0 end-$tail_offset] return $bytes
} }
method meta_is_redirection {} { method meta_is_redirection {} {
return $o_is_junction return $o_is_junction
@ -550,14 +551,14 @@ namespace eval shellfilter::chan {
set inputbytes $o_encbuf$bytes set inputbytes $o_encbuf$bytes
set o_encbuf "" set o_encbuf ""
set tail_offset 0 set tail_offset 0
while {$tail_offset < [string length $inputbytes] && [catch {tcl::encoding::convertfrom $o_enc [string range $inputbytes 0 end-$tail_offset]} stringdata]} { while {$tail_offset < [::tcl::string::length $inputbytes] && [catch {tcl::encoding::convertfrom $o_enc [::tcl::string::range $inputbytes 0 end-$tail_offset]} stringdata]} {
incr tail_offset incr tail_offset
} }
if {$tail_offset > 0} { if {$tail_offset > 0} {
if {$tail_offset < [string length $inputbytes]} { if {$tail_offset < [::tcl::string::length $inputbytes]} {
#stringdata from catch statement must be a valid result #stringdata from catch statement must be a valid result
set t [expr {$tail_offset - 1}] set t [expr {$tail_offset - 1}]
set o_encbuf [string range $inputbytes end-$t end] set o_encbuf [::tcl::string::range $inputbytes end-$t end]
} else { } else {
set stringdata "" set stringdata ""
set o_encbuf $inputbytes set o_encbuf $inputbytes
@ -586,10 +587,10 @@ namespace eval shellfilter::chan {
constructor {tf} { constructor {tf} {
package require punk::ansi package require punk::ansi
set o_trecord $tf set o_trecord $tf
set o_enc [dict get $tf -encoding] set o_enc [::tcl::dict::get $tf -encoding]
set o_encbuf "" set o_encbuf ""
if {[dict exists $tf -junction]} { if {[::tcl::dict::exists $tf -junction]} {
set o_is_junction [dict get $tf -junction] set o_is_junction [::tcl::dict::get $tf -junction]
} else { } else {
set o_is_junction 0 set o_is_junction 0
} }
@ -629,14 +630,14 @@ namespace eval shellfilter::chan {
set inputbytes $o_encbuf$bytes set inputbytes $o_encbuf$bytes
set o_encbuf "" set o_encbuf ""
set tail_offset 0 set tail_offset 0
while {$tail_offset < [string length $inputbytes] && [catch {tcl::encoding::convertfrom $o_enc [string range $inputbytes 0 end-$tail_offset]} stringdata]} { while {$tail_offset < [::tcl::string::length $inputbytes] && [catch {tcl::encoding::convertfrom $o_enc [::tcl::string::range $inputbytes 0 end-$tail_offset]} stringdata]} {
incr tail_offset incr tail_offset
} }
if {$tail_offset > 0} { if {$tail_offset > 0} {
if {$tail_offset < [string length $inputbytes]} { if {$tail_offset < [::tcl::string::length $inputbytes]} {
#stringdata from catch statement must be a valid result #stringdata from catch statement must be a valid result
set t [expr {$tail_offset - 1}] set t [expr {$tail_offset - 1}]
set o_encbuf [string range $inputbytes end-$t end] set o_encbuf [::tcl::string::range $inputbytes end-$t end]
} else { } else {
set stringdata "" set stringdata ""
set o_encbuf $inputbytes set o_encbuf $inputbytes
@ -3343,5 +3344,5 @@ namespace eval shellfilter {
package provide shellfilter [namespace eval shellfilter { package provide shellfilter [namespace eval shellfilter {
variable version variable version
set version 0.2 set version 0.2.1
}] }]

2
src/modules/punk/args-999999.0a1.0.tm

@ -11069,8 +11069,8 @@ tcl::namespace::eval punk::args::argdocbase {
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ # ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
tcl::namespace::eval punk::args::package { tcl::namespace::eval punk::args::package {
variable PUNKARGS variable PUNKARGS
# @dynamic not required?
lappend PUNKARGS [list { lappend PUNKARGS [list {
@dynamic
@id -id "::punk::args::package::standard_about" @id -id "::punk::args::package::standard_about"
@cmd -name "%pkg%::about" -help\ @cmd -name "%pkg%::about" -help\
"About %pkg% "About %pkg%

3348
src/modules/shellfilter-999999.0a1.0.tm

File diff suppressed because it is too large Load Diff

3
src/modules/shellfilter-buildversion.txt

@ -0,0 +1,3 @@
0.2.1
#First line must be a semantic version number
#all other lines are ignored.

2
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/args-0.2.1.tm

@ -11069,8 +11069,8 @@ tcl::namespace::eval punk::args::argdocbase {
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ # ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
tcl::namespace::eval punk::args::package { tcl::namespace::eval punk::args::package {
variable PUNKARGS variable PUNKARGS
# @dynamic not required?
lappend PUNKARGS [list { lappend PUNKARGS [list {
@dynamic
@id -id "::punk::args::package::standard_about" @id -id "::punk::args::package::standard_about"
@cmd -name "%pkg%::about" -help\ @cmd -name "%pkg%::about" -help\
"About %pkg% "About %pkg%

3348
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/shellfilter-0.2.1.tm

File diff suppressed because it is too large Load Diff

2
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/args-0.2.1.tm

@ -11069,8 +11069,8 @@ tcl::namespace::eval punk::args::argdocbase {
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ # ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
tcl::namespace::eval punk::args::package { tcl::namespace::eval punk::args::package {
variable PUNKARGS variable PUNKARGS
# @dynamic not required?
lappend PUNKARGS [list { lappend PUNKARGS [list {
@dynamic
@id -id "::punk::args::package::standard_about" @id -id "::punk::args::package::standard_about"
@cmd -name "%pkg%::about" -help\ @cmd -name "%pkg%::about" -help\
"About %pkg% "About %pkg%

3348
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/shellfilter-0.2.1.tm

File diff suppressed because it is too large Load Diff

2
src/vfs/_vfscommon.vfs/modules/punk/args-0.2.1.tm

@ -11069,8 +11069,8 @@ tcl::namespace::eval punk::args::argdocbase {
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ # ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
tcl::namespace::eval punk::args::package { tcl::namespace::eval punk::args::package {
variable PUNKARGS variable PUNKARGS
# @dynamic not required?
lappend PUNKARGS [list { lappend PUNKARGS [list {
@dynamic
@id -id "::punk::args::package::standard_about" @id -id "::punk::args::package::standard_about"
@cmd -name "%pkg%::about" -help\ @cmd -name "%pkg%::about" -help\
"About %pkg% "About %pkg%

3
src/vfs/_vfscommon.vfs/modules/punk/mix-0.2.1.tm

@ -20,6 +20,7 @@ tcl::namespace::eval punk::mix {
} errTemplates]} { } errTemplates]} {
#emit a warning - but continue on without templates anyway. (punk::mix required to load when using bootsupport paths) #emit a warning - but continue on without templates anyway. (punk::mix required to load when using bootsupport paths)
puts stderr "punk::mix failed to load ZIP archive-based module punk::mix::templates\nUse a modern Tcl with zipfs, or a recent vfs::zip library\nError:$errTemplates" puts stderr "punk::mix failed to load ZIP archive-based module punk::mix::templates\nUse a modern Tcl with zipfs, or a recent vfs::zip library\nError:$errTemplates"
puts stderr "Unable to register any template providers - continuing anyway"
} else { } else {
set t [time { set t [time {
if {[catch {punk::mix::templates::provider register *} errM]} { if {[catch {punk::mix::templates::provider register *} errM]} {
@ -29,9 +30,9 @@ tcl::namespace::eval punk::mix {
puts stderr $::errorInfo puts stderr $::errorInfo
} }
}] }]
}
puts stderr "->punk::mix::templates::provider register * t=$t" puts stderr "->punk::mix::templates::provider register * t=$t"
} }
}
init init
} }

3348
src/vfs/_vfscommon.vfs/modules/shellfilter-0.2.1.tm

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save