Browse Source

punkcheck - try file deletion prior to update - attempt to workaround duplicate data issue

master
Julian Noble 3 months ago
parent
commit
5307dc8850
  1. 10
      src/bootsupport/modules/punkcheck-0.1.0.tm
  2. 10
      src/modules/punkcheck-0.1.0.tm

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

@ -82,12 +82,16 @@ namespace eval punkcheck {
return $record_list return $record_list
} }
proc save_records_to_file {recordlist punkcheck_file {trigger {}}} { 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]]
if {$trigger ne ""} {
puts stderr "\x1b\[36mSaving [llength $recordlist] records as $linecount lines to file '$punkcheck_file' trigger: \x1b\[32m$trigger\x1b\[m"
}
#puts stdout $newtdl #puts stdout $newtdl
if {[file exists $punkcheck_file] && [file type $punkcheck_file] eq "file"} {
file delete $punkcheck_file
}
set fd [open $punkcheck_file w] set fd [open $punkcheck_file w]
chan configure $fd -translation binary chan configure $fd -translation binary
puts -nonewline $fd $newtdl puts -nonewline $fd $newtdl

10
src/modules/punkcheck-0.1.0.tm

@ -82,12 +82,16 @@ namespace eval punkcheck {
return $record_list return $record_list
} }
proc save_records_to_file {recordlist punkcheck_file {trigger {}}} { 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]]
if {$trigger ne ""} {
puts stderr "\x1b\[36mSaving [llength $recordlist] records as $linecount lines to file '$punkcheck_file' trigger: \x1b\[32m$trigger\x1b\[m"
}
#puts stdout $newtdl #puts stdout $newtdl
if {[file exists $punkcheck_file] && [file type $punkcheck_file] eq "file"} {
file delete $punkcheck_file
}
set fd [open $punkcheck_file w] set fd [open $punkcheck_file w]
chan configure $fd -translation binary chan configure $fd -translation binary
puts -nonewline $fd $newtdl puts -nonewline $fd $newtdl

Loading…
Cancel
Save