Browse Source

punkcheck save_records_to_file stderr msgs

master
Julian Noble 3 months ago
parent
commit
6570622a11
  1. 29
      src/bootsupport/modules/punkcheck-0.1.0.tm
  2. 29
      src/modules/punkcheck-0.1.0.tm
  3. 29
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punkcheck-0.1.0.tm
  4. 29
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punkcheck-0.1.0.tm
  5. 29
      src/vfs/_vfscommon.vfs/modules/punkcheck-0.1.0.tm

29
src/bootsupport/modules/punkcheck-0.1.0.tm

@ -81,7 +81,10 @@ namespace eval punkcheck {
} }
return $record_list return $record_list
} }
proc save_records_to_file {recordlist punkcheck_file} { proc save_records_to_file {recordlist punkcheck_file {trigger {}}} {
if {$trigger ne ""} {
puts stderr "\x1b\[36mSaving [llength $recordlist] records to file '$punkcheck_file' trigger: \x1b\[32m$trigger\x1b\[m"
}
set newtdl [punk::tdl::prettyprint $recordlist] set newtdl [punk::tdl::prettyprint $recordlist]
set linecount [llength [split $newtdl \n]] set linecount [llength [split $newtdl \n]]
#puts stdout $newtdl #puts stdout $newtdl
@ -309,7 +312,11 @@ namespace eval punkcheck {
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#load as dict to test for dupes #load as dict to test for dupes
#set _targetdict [my targetset_dict] #set _targetdict [my targetset_dict]
if {[catch {
set _targetdict [punkcheck::recordlist::records_as_target_dict $record_list] set _targetdict [punkcheck::recordlist::records_as_target_dict $record_list]
} errMsg]} {
error "targetset_init operation:$operation error verifying existing records from file $punkcheck_file. Error: $errMsg"
}
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
set extractioninfo [punkcheck::recordlist::extract_or_create_fileset_record $o_targets $record_list] set extractioninfo [punkcheck::recordlist::extract_or_create_fileset_record $o_targets $record_list]
@ -333,7 +340,7 @@ namespace eval punkcheck {
ledit record_list $oldposition -1 $o_fileset_record ledit record_list $oldposition -1 $o_fileset_record
} }
if {$o_operation ne "QUERY"} { if {$o_operation ne "QUERY"} {
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "targetset_init $o_operation [llength $targetset] targets"
} }
return $o_fileset_record return $o_fileset_record
@ -441,7 +448,7 @@ namespace eval punkcheck {
lset record_list $old_posn $o_fileset_record lset record_list $old_posn $o_fileset_record
} }
if {$o_operation ne "QUERY"} { if {$o_operation ne "QUERY"} {
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "targetset_end $o_operation $status [llength $o_targets] targets"
} }
set o_operation_start_ts "" set o_operation_start_ts ""
set o_operation "" set o_operation ""
@ -630,7 +637,7 @@ namespace eval punkcheck {
} else { } else {
lset file_records $existing_header_posn $this_installer_record lset file_records $existing_header_posn $this_installer_record
} }
punkcheck::save_records_to_file $file_records $o_checkfile punkcheck::save_records_to_file $file_records $o_checkfile "save_installer_record"
} }
method events {args} { method events {args} {
tailcall $o_events {*}$args tailcall $o_events {*}$args
@ -664,7 +671,7 @@ namespace eval punkcheck {
#replace #replace
lset o_record_list $existing_header_posn $this_installer_record lset o_record_list $existing_header_posn $this_installer_record
punkcheck::save_records_to_file $o_record_list $o_checkfile punkcheck::save_records_to_file $o_record_list $o_checkfile "start_event $eventid"
set o_active_event $eventobj set o_active_event $eventobj
my events add $eventobj $eventid my events add $eventobj $eventid
return $eventobj return $eventobj
@ -727,7 +734,7 @@ namespace eval punkcheck {
lset record_list $existing_header_posn $this_installer_record lset record_list $existing_header_posn $this_installer_record
} }
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "start_installer_event $eventid"
return [list eventid $eventid recordset $record_list] return [list eventid $eventid recordset $record_list]
} }
#----------------------------------------------- #-----------------------------------------------
@ -807,7 +814,7 @@ namespace eval punkcheck {
ledit record_list $oldposition -1 $file_record ledit record_list $oldposition -1 $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_begin $installername $opt_eventid $target_relpath"
return $file_record return $file_record
} }
@ -1003,7 +1010,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_started_install [llength $targetlist] targets"
return $file_record return $file_record
} }
proc installfile_finished_install {punkcheck_folder file_record} { proc installfile_finished_install {punkcheck_folder file_record} {
@ -1040,7 +1047,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_finished_install [llength $targetlist] targets"
return $file_record return $file_record
} }
proc installfile_skipped_install {punkcheck_folder file_record} { proc installfile_skipped_install {punkcheck_folder file_record} {
@ -1076,7 +1083,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_skipped_install [llength $targetlist] targets"
return $file_record return $file_record
} }
#----------------------------------------------- #-----------------------------------------------
@ -1994,7 +2001,7 @@ namespace eval punkcheck {
if {$CALLDEPTH == 0} { if {$CALLDEPTH == 0} {
if {[llength $files_copied] || [llength $files_skipped]} { if {[llength $files_copied] || [llength $files_skipped]} {
#puts stdout ">>>>>>>>>>>>>>>>>>>" #puts stdout ">>>>>>>>>>>>>>>>>>>"
set saveresult [punkcheck::save_records_to_file $punkcheck_records $punkcheck_file] set saveresult [punkcheck::save_records_to_file $punkcheck_records $punkcheck_file "install $srcdir to $tgtdir"]
puts stdout "\npunkcheck::install [dict get $saveresult recordcount] records saved as [dict get $saveresult linecount] lines to $punkcheck_file copied: [llength $files_copied] skipped: [llength $files_skipped]" puts stdout "\npunkcheck::install [dict get $saveresult recordcount] records saved as [dict get $saveresult linecount] lines to $punkcheck_file copied: [llength $files_copied] skipped: [llength $files_skipped]"
#puts stdout ">>>>>>>>>>>>>>>>>>>" #puts stdout ">>>>>>>>>>>>>>>>>>>"
} else { } else {

29
src/modules/punkcheck-0.1.0.tm

@ -81,7 +81,10 @@ namespace eval punkcheck {
} }
return $record_list return $record_list
} }
proc save_records_to_file {recordlist punkcheck_file} { proc save_records_to_file {recordlist punkcheck_file {trigger {}}} {
if {$trigger ne ""} {
puts stderr "\x1b\[36mSaving [llength $recordlist] records to file '$punkcheck_file' trigger: \x1b\[32m$trigger\x1b\[m"
}
set newtdl [punk::tdl::prettyprint $recordlist] set newtdl [punk::tdl::prettyprint $recordlist]
set linecount [llength [split $newtdl \n]] set linecount [llength [split $newtdl \n]]
#puts stdout $newtdl #puts stdout $newtdl
@ -309,7 +312,11 @@ namespace eval punkcheck {
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#load as dict to test for dupes #load as dict to test for dupes
#set _targetdict [my targetset_dict] #set _targetdict [my targetset_dict]
if {[catch {
set _targetdict [punkcheck::recordlist::records_as_target_dict $record_list] set _targetdict [punkcheck::recordlist::records_as_target_dict $record_list]
} errMsg]} {
error "targetset_init operation:$operation error verifying existing records from file $punkcheck_file. Error: $errMsg"
}
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
set extractioninfo [punkcheck::recordlist::extract_or_create_fileset_record $o_targets $record_list] set extractioninfo [punkcheck::recordlist::extract_or_create_fileset_record $o_targets $record_list]
@ -333,7 +340,7 @@ namespace eval punkcheck {
ledit record_list $oldposition -1 $o_fileset_record ledit record_list $oldposition -1 $o_fileset_record
} }
if {$o_operation ne "QUERY"} { if {$o_operation ne "QUERY"} {
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "targetset_init $o_operation [llength $targetset] targets"
} }
return $o_fileset_record return $o_fileset_record
@ -441,7 +448,7 @@ namespace eval punkcheck {
lset record_list $old_posn $o_fileset_record lset record_list $old_posn $o_fileset_record
} }
if {$o_operation ne "QUERY"} { if {$o_operation ne "QUERY"} {
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "targetset_end $o_operation $status [llength $o_targets] targets"
} }
set o_operation_start_ts "" set o_operation_start_ts ""
set o_operation "" set o_operation ""
@ -630,7 +637,7 @@ namespace eval punkcheck {
} else { } else {
lset file_records $existing_header_posn $this_installer_record lset file_records $existing_header_posn $this_installer_record
} }
punkcheck::save_records_to_file $file_records $o_checkfile punkcheck::save_records_to_file $file_records $o_checkfile "save_installer_record"
} }
method events {args} { method events {args} {
tailcall $o_events {*}$args tailcall $o_events {*}$args
@ -664,7 +671,7 @@ namespace eval punkcheck {
#replace #replace
lset o_record_list $existing_header_posn $this_installer_record lset o_record_list $existing_header_posn $this_installer_record
punkcheck::save_records_to_file $o_record_list $o_checkfile punkcheck::save_records_to_file $o_record_list $o_checkfile "start_event $eventid"
set o_active_event $eventobj set o_active_event $eventobj
my events add $eventobj $eventid my events add $eventobj $eventid
return $eventobj return $eventobj
@ -727,7 +734,7 @@ namespace eval punkcheck {
lset record_list $existing_header_posn $this_installer_record lset record_list $existing_header_posn $this_installer_record
} }
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "start_installer_event $eventid"
return [list eventid $eventid recordset $record_list] return [list eventid $eventid recordset $record_list]
} }
#----------------------------------------------- #-----------------------------------------------
@ -807,7 +814,7 @@ namespace eval punkcheck {
ledit record_list $oldposition -1 $file_record ledit record_list $oldposition -1 $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_begin $installername $opt_eventid $target_relpath"
return $file_record return $file_record
} }
@ -1003,7 +1010,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_started_install [llength $targetlist] targets"
return $file_record return $file_record
} }
proc installfile_finished_install {punkcheck_folder file_record} { proc installfile_finished_install {punkcheck_folder file_record} {
@ -1040,7 +1047,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_finished_install [llength $targetlist] targets"
return $file_record return $file_record
} }
proc installfile_skipped_install {punkcheck_folder file_record} { proc installfile_skipped_install {punkcheck_folder file_record} {
@ -1076,7 +1083,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_skipped_install [llength $targetlist] targets"
return $file_record return $file_record
} }
#----------------------------------------------- #-----------------------------------------------
@ -1994,7 +2001,7 @@ namespace eval punkcheck {
if {$CALLDEPTH == 0} { if {$CALLDEPTH == 0} {
if {[llength $files_copied] || [llength $files_skipped]} { if {[llength $files_copied] || [llength $files_skipped]} {
#puts stdout ">>>>>>>>>>>>>>>>>>>" #puts stdout ">>>>>>>>>>>>>>>>>>>"
set saveresult [punkcheck::save_records_to_file $punkcheck_records $punkcheck_file] set saveresult [punkcheck::save_records_to_file $punkcheck_records $punkcheck_file "install $srcdir to $tgtdir"]
puts stdout "\npunkcheck::install [dict get $saveresult recordcount] records saved as [dict get $saveresult linecount] lines to $punkcheck_file copied: [llength $files_copied] skipped: [llength $files_skipped]" puts stdout "\npunkcheck::install [dict get $saveresult recordcount] records saved as [dict get $saveresult linecount] lines to $punkcheck_file copied: [llength $files_copied] skipped: [llength $files_skipped]"
#puts stdout ">>>>>>>>>>>>>>>>>>>" #puts stdout ">>>>>>>>>>>>>>>>>>>"
} else { } else {

29
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punkcheck-0.1.0.tm

@ -81,7 +81,10 @@ namespace eval punkcheck {
} }
return $record_list return $record_list
} }
proc save_records_to_file {recordlist punkcheck_file} { proc save_records_to_file {recordlist punkcheck_file {trigger {}}} {
if {$trigger ne ""} {
puts stderr "\x1b\[36mSaving [llength $recordlist] records to file '$punkcheck_file' trigger: \x1b\[32m$trigger\x1b\[m"
}
set newtdl [punk::tdl::prettyprint $recordlist] set newtdl [punk::tdl::prettyprint $recordlist]
set linecount [llength [split $newtdl \n]] set linecount [llength [split $newtdl \n]]
#puts stdout $newtdl #puts stdout $newtdl
@ -309,7 +312,11 @@ namespace eval punkcheck {
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#load as dict to test for dupes #load as dict to test for dupes
#set _targetdict [my targetset_dict] #set _targetdict [my targetset_dict]
if {[catch {
set _targetdict [punkcheck::recordlist::records_as_target_dict $record_list] set _targetdict [punkcheck::recordlist::records_as_target_dict $record_list]
} errMsg]} {
error "targetset_init operation:$operation error verifying existing records from file $punkcheck_file. Error: $errMsg"
}
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
set extractioninfo [punkcheck::recordlist::extract_or_create_fileset_record $o_targets $record_list] set extractioninfo [punkcheck::recordlist::extract_or_create_fileset_record $o_targets $record_list]
@ -333,7 +340,7 @@ namespace eval punkcheck {
ledit record_list $oldposition -1 $o_fileset_record ledit record_list $oldposition -1 $o_fileset_record
} }
if {$o_operation ne "QUERY"} { if {$o_operation ne "QUERY"} {
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "targetset_init $o_operation [llength $targetset] targets"
} }
return $o_fileset_record return $o_fileset_record
@ -441,7 +448,7 @@ namespace eval punkcheck {
lset record_list $old_posn $o_fileset_record lset record_list $old_posn $o_fileset_record
} }
if {$o_operation ne "QUERY"} { if {$o_operation ne "QUERY"} {
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "targetset_end $o_operation $status [llength $o_targets] targets"
} }
set o_operation_start_ts "" set o_operation_start_ts ""
set o_operation "" set o_operation ""
@ -630,7 +637,7 @@ namespace eval punkcheck {
} else { } else {
lset file_records $existing_header_posn $this_installer_record lset file_records $existing_header_posn $this_installer_record
} }
punkcheck::save_records_to_file $file_records $o_checkfile punkcheck::save_records_to_file $file_records $o_checkfile "save_installer_record"
} }
method events {args} { method events {args} {
tailcall $o_events {*}$args tailcall $o_events {*}$args
@ -664,7 +671,7 @@ namespace eval punkcheck {
#replace #replace
lset o_record_list $existing_header_posn $this_installer_record lset o_record_list $existing_header_posn $this_installer_record
punkcheck::save_records_to_file $o_record_list $o_checkfile punkcheck::save_records_to_file $o_record_list $o_checkfile "start_event $eventid"
set o_active_event $eventobj set o_active_event $eventobj
my events add $eventobj $eventid my events add $eventobj $eventid
return $eventobj return $eventobj
@ -727,7 +734,7 @@ namespace eval punkcheck {
lset record_list $existing_header_posn $this_installer_record lset record_list $existing_header_posn $this_installer_record
} }
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "start_installer_event $eventid"
return [list eventid $eventid recordset $record_list] return [list eventid $eventid recordset $record_list]
} }
#----------------------------------------------- #-----------------------------------------------
@ -807,7 +814,7 @@ namespace eval punkcheck {
ledit record_list $oldposition -1 $file_record ledit record_list $oldposition -1 $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_begin $installername $opt_eventid $target_relpath"
return $file_record return $file_record
} }
@ -1003,7 +1010,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_started_install [llength $targetlist] targets"
return $file_record return $file_record
} }
proc installfile_finished_install {punkcheck_folder file_record} { proc installfile_finished_install {punkcheck_folder file_record} {
@ -1040,7 +1047,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_finished_install [llength $targetlist] targets"
return $file_record return $file_record
} }
proc installfile_skipped_install {punkcheck_folder file_record} { proc installfile_skipped_install {punkcheck_folder file_record} {
@ -1076,7 +1083,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_skipped_install [llength $targetlist] targets"
return $file_record return $file_record
} }
#----------------------------------------------- #-----------------------------------------------
@ -1994,7 +2001,7 @@ namespace eval punkcheck {
if {$CALLDEPTH == 0} { if {$CALLDEPTH == 0} {
if {[llength $files_copied] || [llength $files_skipped]} { if {[llength $files_copied] || [llength $files_skipped]} {
#puts stdout ">>>>>>>>>>>>>>>>>>>" #puts stdout ">>>>>>>>>>>>>>>>>>>"
set saveresult [punkcheck::save_records_to_file $punkcheck_records $punkcheck_file] set saveresult [punkcheck::save_records_to_file $punkcheck_records $punkcheck_file "install $srcdir to $tgtdir"]
puts stdout "\npunkcheck::install [dict get $saveresult recordcount] records saved as [dict get $saveresult linecount] lines to $punkcheck_file copied: [llength $files_copied] skipped: [llength $files_skipped]" puts stdout "\npunkcheck::install [dict get $saveresult recordcount] records saved as [dict get $saveresult linecount] lines to $punkcheck_file copied: [llength $files_copied] skipped: [llength $files_skipped]"
#puts stdout ">>>>>>>>>>>>>>>>>>>" #puts stdout ">>>>>>>>>>>>>>>>>>>"
} else { } else {

29
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punkcheck-0.1.0.tm

@ -81,7 +81,10 @@ namespace eval punkcheck {
} }
return $record_list return $record_list
} }
proc save_records_to_file {recordlist punkcheck_file} { proc save_records_to_file {recordlist punkcheck_file {trigger {}}} {
if {$trigger ne ""} {
puts stderr "\x1b\[36mSaving [llength $recordlist] records to file '$punkcheck_file' trigger: \x1b\[32m$trigger\x1b\[m"
}
set newtdl [punk::tdl::prettyprint $recordlist] set newtdl [punk::tdl::prettyprint $recordlist]
set linecount [llength [split $newtdl \n]] set linecount [llength [split $newtdl \n]]
#puts stdout $newtdl #puts stdout $newtdl
@ -309,7 +312,11 @@ namespace eval punkcheck {
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#load as dict to test for dupes #load as dict to test for dupes
#set _targetdict [my targetset_dict] #set _targetdict [my targetset_dict]
if {[catch {
set _targetdict [punkcheck::recordlist::records_as_target_dict $record_list] set _targetdict [punkcheck::recordlist::records_as_target_dict $record_list]
} errMsg]} {
error "targetset_init operation:$operation error verifying existing records from file $punkcheck_file. Error: $errMsg"
}
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
set extractioninfo [punkcheck::recordlist::extract_or_create_fileset_record $o_targets $record_list] set extractioninfo [punkcheck::recordlist::extract_or_create_fileset_record $o_targets $record_list]
@ -333,7 +340,7 @@ namespace eval punkcheck {
ledit record_list $oldposition -1 $o_fileset_record ledit record_list $oldposition -1 $o_fileset_record
} }
if {$o_operation ne "QUERY"} { if {$o_operation ne "QUERY"} {
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "targetset_init $o_operation [llength $targetset] targets"
} }
return $o_fileset_record return $o_fileset_record
@ -441,7 +448,7 @@ namespace eval punkcheck {
lset record_list $old_posn $o_fileset_record lset record_list $old_posn $o_fileset_record
} }
if {$o_operation ne "QUERY"} { if {$o_operation ne "QUERY"} {
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "targetset_end $o_operation $status [llength $o_targets] targets"
} }
set o_operation_start_ts "" set o_operation_start_ts ""
set o_operation "" set o_operation ""
@ -630,7 +637,7 @@ namespace eval punkcheck {
} else { } else {
lset file_records $existing_header_posn $this_installer_record lset file_records $existing_header_posn $this_installer_record
} }
punkcheck::save_records_to_file $file_records $o_checkfile punkcheck::save_records_to_file $file_records $o_checkfile "save_installer_record"
} }
method events {args} { method events {args} {
tailcall $o_events {*}$args tailcall $o_events {*}$args
@ -664,7 +671,7 @@ namespace eval punkcheck {
#replace #replace
lset o_record_list $existing_header_posn $this_installer_record lset o_record_list $existing_header_posn $this_installer_record
punkcheck::save_records_to_file $o_record_list $o_checkfile punkcheck::save_records_to_file $o_record_list $o_checkfile "start_event $eventid"
set o_active_event $eventobj set o_active_event $eventobj
my events add $eventobj $eventid my events add $eventobj $eventid
return $eventobj return $eventobj
@ -727,7 +734,7 @@ namespace eval punkcheck {
lset record_list $existing_header_posn $this_installer_record lset record_list $existing_header_posn $this_installer_record
} }
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "start_installer_event $eventid"
return [list eventid $eventid recordset $record_list] return [list eventid $eventid recordset $record_list]
} }
#----------------------------------------------- #-----------------------------------------------
@ -807,7 +814,7 @@ namespace eval punkcheck {
ledit record_list $oldposition -1 $file_record ledit record_list $oldposition -1 $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_begin $installername $opt_eventid $target_relpath"
return $file_record return $file_record
} }
@ -1003,7 +1010,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_started_install [llength $targetlist] targets"
return $file_record return $file_record
} }
proc installfile_finished_install {punkcheck_folder file_record} { proc installfile_finished_install {punkcheck_folder file_record} {
@ -1040,7 +1047,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_finished_install [llength $targetlist] targets"
return $file_record return $file_record
} }
proc installfile_skipped_install {punkcheck_folder file_record} { proc installfile_skipped_install {punkcheck_folder file_record} {
@ -1076,7 +1083,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_skipped_install [llength $targetlist] targets"
return $file_record return $file_record
} }
#----------------------------------------------- #-----------------------------------------------
@ -1994,7 +2001,7 @@ namespace eval punkcheck {
if {$CALLDEPTH == 0} { if {$CALLDEPTH == 0} {
if {[llength $files_copied] || [llength $files_skipped]} { if {[llength $files_copied] || [llength $files_skipped]} {
#puts stdout ">>>>>>>>>>>>>>>>>>>" #puts stdout ">>>>>>>>>>>>>>>>>>>"
set saveresult [punkcheck::save_records_to_file $punkcheck_records $punkcheck_file] set saveresult [punkcheck::save_records_to_file $punkcheck_records $punkcheck_file "install $srcdir to $tgtdir"]
puts stdout "\npunkcheck::install [dict get $saveresult recordcount] records saved as [dict get $saveresult linecount] lines to $punkcheck_file copied: [llength $files_copied] skipped: [llength $files_skipped]" puts stdout "\npunkcheck::install [dict get $saveresult recordcount] records saved as [dict get $saveresult linecount] lines to $punkcheck_file copied: [llength $files_copied] skipped: [llength $files_skipped]"
#puts stdout ">>>>>>>>>>>>>>>>>>>" #puts stdout ">>>>>>>>>>>>>>>>>>>"
} else { } else {

29
src/vfs/_vfscommon.vfs/modules/punkcheck-0.1.0.tm

@ -81,7 +81,10 @@ namespace eval punkcheck {
} }
return $record_list return $record_list
} }
proc save_records_to_file {recordlist punkcheck_file} { proc save_records_to_file {recordlist punkcheck_file {trigger {}}} {
if {$trigger ne ""} {
puts stderr "\x1b\[36mSaving [llength $recordlist] records to file '$punkcheck_file' trigger: \x1b\[32m$trigger\x1b\[m"
}
set newtdl [punk::tdl::prettyprint $recordlist] set newtdl [punk::tdl::prettyprint $recordlist]
set linecount [llength [split $newtdl \n]] set linecount [llength [split $newtdl \n]]
#puts stdout $newtdl #puts stdout $newtdl
@ -309,7 +312,11 @@ namespace eval punkcheck {
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#load as dict to test for dupes #load as dict to test for dupes
#set _targetdict [my targetset_dict] #set _targetdict [my targetset_dict]
if {[catch {
set _targetdict [punkcheck::recordlist::records_as_target_dict $record_list] set _targetdict [punkcheck::recordlist::records_as_target_dict $record_list]
} errMsg]} {
error "targetset_init operation:$operation error verifying existing records from file $punkcheck_file. Error: $errMsg"
}
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
set extractioninfo [punkcheck::recordlist::extract_or_create_fileset_record $o_targets $record_list] set extractioninfo [punkcheck::recordlist::extract_or_create_fileset_record $o_targets $record_list]
@ -333,7 +340,7 @@ namespace eval punkcheck {
ledit record_list $oldposition -1 $o_fileset_record ledit record_list $oldposition -1 $o_fileset_record
} }
if {$o_operation ne "QUERY"} { if {$o_operation ne "QUERY"} {
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "targetset_init $o_operation [llength $targetset] targets"
} }
return $o_fileset_record return $o_fileset_record
@ -441,7 +448,7 @@ namespace eval punkcheck {
lset record_list $old_posn $o_fileset_record lset record_list $old_posn $o_fileset_record
} }
if {$o_operation ne "QUERY"} { if {$o_operation ne "QUERY"} {
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "targetset_end $o_operation $status [llength $o_targets] targets"
} }
set o_operation_start_ts "" set o_operation_start_ts ""
set o_operation "" set o_operation ""
@ -630,7 +637,7 @@ namespace eval punkcheck {
} else { } else {
lset file_records $existing_header_posn $this_installer_record lset file_records $existing_header_posn $this_installer_record
} }
punkcheck::save_records_to_file $file_records $o_checkfile punkcheck::save_records_to_file $file_records $o_checkfile "save_installer_record"
} }
method events {args} { method events {args} {
tailcall $o_events {*}$args tailcall $o_events {*}$args
@ -664,7 +671,7 @@ namespace eval punkcheck {
#replace #replace
lset o_record_list $existing_header_posn $this_installer_record lset o_record_list $existing_header_posn $this_installer_record
punkcheck::save_records_to_file $o_record_list $o_checkfile punkcheck::save_records_to_file $o_record_list $o_checkfile "start_event $eventid"
set o_active_event $eventobj set o_active_event $eventobj
my events add $eventobj $eventid my events add $eventobj $eventid
return $eventobj return $eventobj
@ -727,7 +734,7 @@ namespace eval punkcheck {
lset record_list $existing_header_posn $this_installer_record lset record_list $existing_header_posn $this_installer_record
} }
punkcheck::save_records_to_file $record_list $punkcheck_file punkcheck::save_records_to_file $record_list $punkcheck_file "start_installer_event $eventid"
return [list eventid $eventid recordset $record_list] return [list eventid $eventid recordset $record_list]
} }
#----------------------------------------------- #-----------------------------------------------
@ -807,7 +814,7 @@ namespace eval punkcheck {
ledit record_list $oldposition -1 $file_record ledit record_list $oldposition -1 $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_begin $installername $opt_eventid $target_relpath"
return $file_record return $file_record
} }
@ -1003,7 +1010,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_started_install [llength $targetlist] targets"
return $file_record return $file_record
} }
proc installfile_finished_install {punkcheck_folder file_record} { proc installfile_finished_install {punkcheck_folder file_record} {
@ -1040,7 +1047,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_finished_install [llength $targetlist] targets"
return $file_record return $file_record
} }
proc installfile_skipped_install {punkcheck_folder file_record} { proc installfile_skipped_install {punkcheck_folder file_record} {
@ -1076,7 +1083,7 @@ namespace eval punkcheck {
lset record_list $old_posn $file_record lset record_list $old_posn $file_record
} }
save_records_to_file $record_list $punkcheck_file save_records_to_file $record_list $punkcheck_file "installfile_skipped_install [llength $targetlist] targets"
return $file_record return $file_record
} }
#----------------------------------------------- #-----------------------------------------------
@ -1994,7 +2001,7 @@ namespace eval punkcheck {
if {$CALLDEPTH == 0} { if {$CALLDEPTH == 0} {
if {[llength $files_copied] || [llength $files_skipped]} { if {[llength $files_copied] || [llength $files_skipped]} {
#puts stdout ">>>>>>>>>>>>>>>>>>>" #puts stdout ">>>>>>>>>>>>>>>>>>>"
set saveresult [punkcheck::save_records_to_file $punkcheck_records $punkcheck_file] set saveresult [punkcheck::save_records_to_file $punkcheck_records $punkcheck_file "install $srcdir to $tgtdir"]
puts stdout "\npunkcheck::install [dict get $saveresult recordcount] records saved as [dict get $saveresult linecount] lines to $punkcheck_file copied: [llength $files_copied] skipped: [llength $files_skipped]" puts stdout "\npunkcheck::install [dict get $saveresult recordcount] records saved as [dict get $saveresult linecount] lines to $punkcheck_file copied: [llength $files_copied] skipped: [llength $files_skipped]"
#puts stdout ">>>>>>>>>>>>>>>>>>>" #puts stdout ">>>>>>>>>>>>>>>>>>>"
} else { } else {

Loading…
Cancel
Save