"Name of channel e.g stderr, stdout to which progress messages are written.
This includes the tree-like output consisting of dots (or green U) for each
file processed. As the number of files in a tree is not known beforehand,
it isn't useful for a percentage-based progress meter, but it could potentially
be used to drive a spinner if the textual data is not desired.
Setting to none or an invalid channel will deactivate the output."
}]
}]
## unidirectional file transfer to possibly non empty folder
## unidirectional file transfer to possibly non empty folder
#default of -overwrite no-targets will only copy files that are missing at the target
#default of -overwrite no-targets will only copy files that are missing at the target
@ -1343,6 +1369,7 @@ namespace eval punkcheck {
-punkcheck_eventid "\uFFFF"\
-punkcheck_eventid "\uFFFF"\
-punkcheck_records ""\
-punkcheck_records ""\
-installer punkcheck::install\
-installer punkcheck::install\
-progresschannel none\
]
]
if {([llength $args] %2) != 0} {
if {([llength $args] %2) != 0} {
@ -1367,6 +1394,10 @@ namespace eval punkcheck {
set fileglob [dict get $opts -glob]
set fileglob [dict get $opts -glob]
set createdir [dict get $opts -createdir] ;#defaults to zero to help avoid mistakes with initial target dir - required target subdirs are created regardless of this setting
set createdir [dict get $opts -createdir] ;#defaults to zero to help avoid mistakes with initial target dir - required target subdirs are created regardless of this setting
set opt_createempty [dict get $opts -createempty]
set opt_createempty [dict get $opts -createempty]
set opt_progresschannel [dict get $opts -progresschannel]
if {$opt_progresschannel in {"" none} || [catch {chan configure $opt_progresschannel}]} {
set opt_progresschannel ""
}
if {$CALLDEPTH == 0} {
if {$CALLDEPTH == 0} {
#expensive to normalize but we need to do it at least once
#expensive to normalize but we need to do it at least once
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
lappend files_copied $current_source_dir/$m
lappend files_copied $current_source_dir/$m
incr filecount_new
incr filecount_new
set is_new 1
} else {
} else {
switch -- $overwrite_what {
switch -- $overwrite_what {
installedsourcechanged-targets {
installedsourcechanged-targets {
@ -1747,14 +1777,16 @@ namespace eval punkcheck {
}
}
}
}
synced-targets {
synced-targets {
#disallow overwriting of target that has been modified by some other mechanism
#review
if {[llength $changed]} {
if {[llength $changed]} {
#only overwrite if the target checksum equals the last installed checksum (ie target is in sync with source and so hasn't been customized)
#only overwrite if the target file checksum equals the last installed checksum (ie target is in sync with previous source-set and so hasn't been customized)
set existing_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set existing_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set is_target_unmodified_since_install 0
set is_target_unmodified_since_install 0
set target_cksum_compare "unknown"
set target_cksum_compare "unknown"
set latest_install_record [punkcheck::recordlist::file_record_latest_installrecord $filerec] ;#may be no such record - in which case we get an empty list
set latest_install_record [punkcheck::recordlist::file_record_latest_installrecord $filerec] ;#may be no such record - in which case we get an empty list
if {[dict exists $latest_install_record -targets_cksums]} {
if {[dict exists $latest_install_record -targets_cksums]} {
set last_install_cksum [dict get $latest_install_record -targets_cksums] ;#in this case we know there is only one as 'install' always uses targetset size of 1. (FILEINFO record per file in source folder)
set last_install_cksum [dict get $latest_install_record -targets_cksums] ;#in this case we know there is only one as 'install' always uses targetset size of 1. (FILEINFO record per file in source folder)
if {[dict get $existing_tgt_cksum_info cksum] eq $last_install_cksum} {
if {[dict get $existing_tgt_cksum_info cksum] eq $last_install_cksum} {
#add PUNK to the tail end of the more usual -errorcode {TCL WRONGARGS} so we maintain reasonable compat with things looking for TCL WRONGARGS - but also differentiate it.
#add PUNK to the tail end of the more usual -errorcode {TCL WRONGARGS} so we maintain reasonable compat with things looking for TCL WRONGARGS - but also differentiate it.
"Name of channel e.g stderr, stdout to which progress messages are written.
This includes the tree-like output consisting of dots (or green U) for each
file processed. As the number of files in a tree is not known beforehand,
it isn't useful for a percentage-based progress meter, but it could potentially
be used to drive a spinner if the textual data is not desired.
Setting to none or an invalid channel will deactivate the output."
}]
}]
## unidirectional file transfer to possibly non empty folder
## unidirectional file transfer to possibly non empty folder
#default of -overwrite no-targets will only copy files that are missing at the target
#default of -overwrite no-targets will only copy files that are missing at the target
@ -1343,6 +1369,7 @@ namespace eval punkcheck {
-punkcheck_eventid "\uFFFF"\
-punkcheck_eventid "\uFFFF"\
-punkcheck_records ""\
-punkcheck_records ""\
-installer punkcheck::install\
-installer punkcheck::install\
-progresschannel none\
]
]
if {([llength $args] %2) != 0} {
if {([llength $args] %2) != 0} {
@ -1367,6 +1394,10 @@ namespace eval punkcheck {
set fileglob [dict get $opts -glob]
set fileglob [dict get $opts -glob]
set createdir [dict get $opts -createdir] ;#defaults to zero to help avoid mistakes with initial target dir - required target subdirs are created regardless of this setting
set createdir [dict get $opts -createdir] ;#defaults to zero to help avoid mistakes with initial target dir - required target subdirs are created regardless of this setting
set opt_createempty [dict get $opts -createempty]
set opt_createempty [dict get $opts -createempty]
set opt_progresschannel [dict get $opts -progresschannel]
if {$opt_progresschannel in {"" none} || [catch {chan configure $opt_progresschannel}]} {
set opt_progresschannel ""
}
if {$CALLDEPTH == 0} {
if {$CALLDEPTH == 0} {
#expensive to normalize but we need to do it at least once
#expensive to normalize but we need to do it at least once
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
lappend files_copied $current_source_dir/$m
lappend files_copied $current_source_dir/$m
incr filecount_new
incr filecount_new
set is_new 1
} else {
} else {
switch -- $overwrite_what {
switch -- $overwrite_what {
installedsourcechanged-targets {
installedsourcechanged-targets {
@ -1747,14 +1777,16 @@ namespace eval punkcheck {
}
}
}
}
synced-targets {
synced-targets {
#disallow overwriting of target that has been modified by some other mechanism
#review
if {[llength $changed]} {
if {[llength $changed]} {
#only overwrite if the target checksum equals the last installed checksum (ie target is in sync with source and so hasn't been customized)
#only overwrite if the target file checksum equals the last installed checksum (ie target is in sync with previous source-set and so hasn't been customized)
set existing_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set existing_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set is_target_unmodified_since_install 0
set is_target_unmodified_since_install 0
set target_cksum_compare "unknown"
set target_cksum_compare "unknown"
set latest_install_record [punkcheck::recordlist::file_record_latest_installrecord $filerec] ;#may be no such record - in which case we get an empty list
set latest_install_record [punkcheck::recordlist::file_record_latest_installrecord $filerec] ;#may be no such record - in which case we get an empty list
if {[dict exists $latest_install_record -targets_cksums]} {
if {[dict exists $latest_install_record -targets_cksums]} {
set last_install_cksum [dict get $latest_install_record -targets_cksums] ;#in this case we know there is only one as 'install' always uses targetset size of 1. (FILEINFO record per file in source folder)
set last_install_cksum [dict get $latest_install_record -targets_cksums] ;#in this case we know there is only one as 'install' always uses targetset size of 1. (FILEINFO record per file in source folder)
if {[dict get $existing_tgt_cksum_info cksum] eq $last_install_cksum} {
if {[dict get $existing_tgt_cksum_info cksum] eq $last_install_cksum} {
"Name of channel e.g stderr, stdout to which progress messages are written.
This includes the tree-like output consisting of dots (or green U) for each
file processed. As the number of files in a tree is not known beforehand,
it isn't useful for a percentage-based progress meter, but it could potentially
be used to drive a spinner if the textual data is not desired.
Setting to none or an invalid channel will deactivate the output."
}]
}]
## unidirectional file transfer to possibly non empty folder
## unidirectional file transfer to possibly non empty folder
#default of -overwrite no-targets will only copy files that are missing at the target
#default of -overwrite no-targets will only copy files that are missing at the target
@ -1343,6 +1369,7 @@ namespace eval punkcheck {
-punkcheck_eventid "\uFFFF"\
-punkcheck_eventid "\uFFFF"\
-punkcheck_records ""\
-punkcheck_records ""\
-installer punkcheck::install\
-installer punkcheck::install\
-progresschannel none\
]
]
if {([llength $args] %2) != 0} {
if {([llength $args] %2) != 0} {
@ -1367,6 +1394,10 @@ namespace eval punkcheck {
set fileglob [dict get $opts -glob]
set fileglob [dict get $opts -glob]
set createdir [dict get $opts -createdir] ;#defaults to zero to help avoid mistakes with initial target dir - required target subdirs are created regardless of this setting
set createdir [dict get $opts -createdir] ;#defaults to zero to help avoid mistakes with initial target dir - required target subdirs are created regardless of this setting
set opt_createempty [dict get $opts -createempty]
set opt_createempty [dict get $opts -createempty]
set opt_progresschannel [dict get $opts -progresschannel]
if {$opt_progresschannel in {"" none} || [catch {chan configure $opt_progresschannel}]} {
set opt_progresschannel ""
}
if {$CALLDEPTH == 0} {
if {$CALLDEPTH == 0} {
#expensive to normalize but we need to do it at least once
#expensive to normalize but we need to do it at least once
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
lappend files_copied $current_source_dir/$m
lappend files_copied $current_source_dir/$m
incr filecount_new
incr filecount_new
set is_new 1
} else {
} else {
switch -- $overwrite_what {
switch -- $overwrite_what {
installedsourcechanged-targets {
installedsourcechanged-targets {
@ -1747,14 +1777,16 @@ namespace eval punkcheck {
}
}
}
}
synced-targets {
synced-targets {
#disallow overwriting of target that has been modified by some other mechanism
#review
if {[llength $changed]} {
if {[llength $changed]} {
#only overwrite if the target checksum equals the last installed checksum (ie target is in sync with source and so hasn't been customized)
#only overwrite if the target file checksum equals the last installed checksum (ie target is in sync with previous source-set and so hasn't been customized)
set existing_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set existing_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set is_target_unmodified_since_install 0
set is_target_unmodified_since_install 0
set target_cksum_compare "unknown"
set target_cksum_compare "unknown"
set latest_install_record [punkcheck::recordlist::file_record_latest_installrecord $filerec] ;#may be no such record - in which case we get an empty list
set latest_install_record [punkcheck::recordlist::file_record_latest_installrecord $filerec] ;#may be no such record - in which case we get an empty list
if {[dict exists $latest_install_record -targets_cksums]} {
if {[dict exists $latest_install_record -targets_cksums]} {
set last_install_cksum [dict get $latest_install_record -targets_cksums] ;#in this case we know there is only one as 'install' always uses targetset size of 1. (FILEINFO record per file in source folder)
set last_install_cksum [dict get $latest_install_record -targets_cksums] ;#in this case we know there is only one as 'install' always uses targetset size of 1. (FILEINFO record per file in source folder)
if {[dict get $existing_tgt_cksum_info cksum] eq $last_install_cksum} {
if {[dict get $existing_tgt_cksum_info cksum] eq $last_install_cksum} {
"Name of channel e.g stderr, stdout to which progress messages are written.
This includes the tree-like output consisting of dots (or green U) for each
file processed. As the number of files in a tree is not known beforehand,
it isn't useful for a percentage-based progress meter, but it could potentially
be used to drive a spinner if the textual data is not desired.
Setting to none or an invalid channel will deactivate the output."
}]
}]
## unidirectional file transfer to possibly non empty folder
## unidirectional file transfer to possibly non empty folder
#default of -overwrite no-targets will only copy files that are missing at the target
#default of -overwrite no-targets will only copy files that are missing at the target
@ -1343,6 +1369,7 @@ namespace eval punkcheck {
-punkcheck_eventid "\uFFFF"\
-punkcheck_eventid "\uFFFF"\
-punkcheck_records ""\
-punkcheck_records ""\
-installer punkcheck::install\
-installer punkcheck::install\
-progresschannel none\
]
]
if {([llength $args] %2) != 0} {
if {([llength $args] %2) != 0} {
@ -1367,6 +1394,10 @@ namespace eval punkcheck {
set fileglob [dict get $opts -glob]
set fileglob [dict get $opts -glob]
set createdir [dict get $opts -createdir] ;#defaults to zero to help avoid mistakes with initial target dir - required target subdirs are created regardless of this setting
set createdir [dict get $opts -createdir] ;#defaults to zero to help avoid mistakes with initial target dir - required target subdirs are created regardless of this setting
set opt_createempty [dict get $opts -createempty]
set opt_createempty [dict get $opts -createempty]
set opt_progresschannel [dict get $opts -progresschannel]
if {$opt_progresschannel in {"" none} || [catch {chan configure $opt_progresschannel}]} {
set opt_progresschannel ""
}
if {$CALLDEPTH == 0} {
if {$CALLDEPTH == 0} {
#expensive to normalize but we need to do it at least once
#expensive to normalize but we need to do it at least once
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
lappend files_copied $current_source_dir/$m
lappend files_copied $current_source_dir/$m
incr filecount_new
incr filecount_new
set is_new 1
} else {
} else {
switch -- $overwrite_what {
switch -- $overwrite_what {
installedsourcechanged-targets {
installedsourcechanged-targets {
@ -1747,14 +1777,16 @@ namespace eval punkcheck {
}
}
}
}
synced-targets {
synced-targets {
#disallow overwriting of target that has been modified by some other mechanism
#review
if {[llength $changed]} {
if {[llength $changed]} {
#only overwrite if the target checksum equals the last installed checksum (ie target is in sync with source and so hasn't been customized)
#only overwrite if the target file checksum equals the last installed checksum (ie target is in sync with previous source-set and so hasn't been customized)
set existing_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set existing_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set is_target_unmodified_since_install 0
set is_target_unmodified_since_install 0
set target_cksum_compare "unknown"
set target_cksum_compare "unknown"
set latest_install_record [punkcheck::recordlist::file_record_latest_installrecord $filerec] ;#may be no such record - in which case we get an empty list
set latest_install_record [punkcheck::recordlist::file_record_latest_installrecord $filerec] ;#may be no such record - in which case we get an empty list
if {[dict exists $latest_install_record -targets_cksums]} {
if {[dict exists $latest_install_record -targets_cksums]} {
set last_install_cksum [dict get $latest_install_record -targets_cksums] ;#in this case we know there is only one as 'install' always uses targetset size of 1. (FILEINFO record per file in source folder)
set last_install_cksum [dict get $latest_install_record -targets_cksums] ;#in this case we know there is only one as 'install' always uses targetset size of 1. (FILEINFO record per file in source folder)
if {[dict get $existing_tgt_cksum_info cksum] eq $last_install_cksum} {
if {[dict get $existing_tgt_cksum_info cksum] eq $last_install_cksum} {
"Name of channel e.g stderr, stdout to which progress messages are written.
This includes the tree-like output consisting of dots (or green U) for each
file processed. As the number of files in a tree is not known beforehand,
it isn't useful for a percentage-based progress meter, but it could potentially
be used to drive a spinner if the textual data is not desired.
Setting to none or an invalid channel will deactivate the output."
}]
}]
## unidirectional file transfer to possibly non empty folder
## unidirectional file transfer to possibly non empty folder
#default of -overwrite no-targets will only copy files that are missing at the target
#default of -overwrite no-targets will only copy files that are missing at the target
@ -1343,6 +1369,7 @@ namespace eval punkcheck {
-punkcheck_eventid "\uFFFF"\
-punkcheck_eventid "\uFFFF"\
-punkcheck_records ""\
-punkcheck_records ""\
-installer punkcheck::install\
-installer punkcheck::install\
-progresschannel none\
]
]
if {([llength $args] %2) != 0} {
if {([llength $args] %2) != 0} {
@ -1367,6 +1394,10 @@ namespace eval punkcheck {
set fileglob [dict get $opts -glob]
set fileglob [dict get $opts -glob]
set createdir [dict get $opts -createdir] ;#defaults to zero to help avoid mistakes with initial target dir - required target subdirs are created regardless of this setting
set createdir [dict get $opts -createdir] ;#defaults to zero to help avoid mistakes with initial target dir - required target subdirs are created regardless of this setting
set opt_createempty [dict get $opts -createempty]
set opt_createempty [dict get $opts -createempty]
set opt_progresschannel [dict get $opts -progresschannel]
if {$opt_progresschannel in {"" none} || [catch {chan configure $opt_progresschannel}]} {
set opt_progresschannel ""
}
if {$CALLDEPTH == 0} {
if {$CALLDEPTH == 0} {
#expensive to normalize but we need to do it at least once
#expensive to normalize but we need to do it at least once
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set new_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
lappend files_copied $current_source_dir/$m
lappend files_copied $current_source_dir/$m
incr filecount_new
incr filecount_new
set is_new 1
} else {
} else {
switch -- $overwrite_what {
switch -- $overwrite_what {
installedsourcechanged-targets {
installedsourcechanged-targets {
@ -1737,14 +1777,16 @@ namespace eval punkcheck {
}
}
}
}
synced-targets {
synced-targets {
#disallow overwriting of target that has been modified by some other mechanism
#review
if {[llength $changed]} {
if {[llength $changed]} {
#only overwrite if the target checksum equals the last installed checksum (ie target is in sync with source and so hasn't been customized)
#only overwrite if the target file checksum equals the last installed checksum (ie target is in sync with previous source-set and so hasn't been customized)
set existing_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set existing_tgt_cksum_info [punk::mix::base::lib::cksum_path $current_target_dir/$m]
set is_target_unmodified_since_install 0
set is_target_unmodified_since_install 0
set target_cksum_compare "unknown"
set target_cksum_compare "unknown"
set latest_install_record [punkcheck::recordlist::file_record_latest_installrecord $filerec] ;#may be no such record - in which case we get an empty list
set latest_install_record [punkcheck::recordlist::file_record_latest_installrecord $filerec] ;#may be no such record - in which case we get an empty list
if {[dict exists $latest_install_record -targets_cksums]} {
if {[dict exists $latest_install_record -targets_cksums]} {
set last_install_cksum [dict get $latest_install_record -targets_cksums] ;#in this case we know there is only one as 'install' always uses targetset size of 1. (FILEINFO record per file in source folder)
set last_install_cksum [dict get $latest_install_record -targets_cksums] ;#in this case we know there is only one as 'install' always uses targetset size of 1. (FILEINFO record per file in source folder)
if {[dict get $existing_tgt_cksum_info cksum] eq $last_install_cksum} {
if {[dict get $existing_tgt_cksum_info cksum] eq $last_install_cksum} {
set subdirs [glob -nocomplain -dir $current_source_dir -type d -tail *]
set subdirs [glob -nocomplain -dir $current_source_dir -type d -tail *]
@ -1893,6 +1961,7 @@ namespace eval punkcheck {
-punkcheck_folder $punkcheck_folder\
-punkcheck_folder $punkcheck_folder\
-punkcheck_eventid $punkcheck_eventid\
-punkcheck_eventid $punkcheck_eventid\
-punkcheck_records $punkcheck_records\
-punkcheck_records $punkcheck_records\
-progresschannel $opt_progresschannel\
]
]
set sub_opts [dict merge $opts $sub_opts]
set sub_opts [dict merge $opts $sub_opts]
set sub_result [punkcheck::install $srcdir $tgtdir {*}$sub_opts]
set sub_result [punkcheck::install $srcdir $tgtdir {*}$sub_opts]
@ -1910,7 +1979,7 @@ namespace eval punkcheck {
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]
puts stdout "punkcheck::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]"