puts stderr "\x1b\[32mNo existing records found in punkcheck file '$o_checkfile' for installer '$installername'. Starting with empty record list.\x1b\[m"
} else {
#verify no duplicate installer records for this installer.
#JMN
set sanity_dict [dict create]
set insane ""
foreach rec $o_record_list {
if {[dict get $rec tag] eq "INSTALLER"} {
set name [dict get $rec -name]
if {[dict exists $sanity_dict $name]} {
#todo - warn - duplicate record for same targetlist - shouldn't happen as we should be using get_file_record to find existing records
puts stderr "\x1b\[31mpunkcheck::recordlist::records_as_target_dict - multiple records with same targetlist '$tgtlist'\x1b\[m"
set insane "$name"
break
}
dict set sanity_dict $name {}
}
}
if {$insane ne ""} {
set msg "Sanity check: punkcheck file '$o_checkfile' contains multiple records for INSTALLER -name '$insane'."
append msg \n "This may indicate a problem such as multiple concurrent installtrack instances using the same punkcheck file,"
append msg \n " or a previous installtrack instance that did not complete properly."
append msg \n " Please verify that this is expected and safe to proceed before confirming with 'yes'."
set answer [punk::lib::askuser $msg]
if {$answer ne "yes"} {
error "Aborting due to sanity check failure. User did not confirm with 'yes'."
}
if {[file exists $o_checkfile] && [file isfile $o_checkfile]} {
file delete $o_checkfile
}
if {[file exists $o_checkfile]} {
error "Failed to delete punkcheck file '$o_checkfile' after sanity check failure. Please investigate and resolve the issue before proceeding."
}
set o_record_list [list]
} else {
puts stderr "\x1b\[32mSanity check passed: no duplicate INSTALLER records found for installer '$installername' in punkcheck file '$o_checkfile'.\x1b\[m"
}
unset sanity_dict
}
set resultinfo [punkcheck::recordlist::get_installer_record $o_name $o_record_list]
set resultinfo [punkcheck::recordlist::get_installer_record $o_name $o_record_list]
set existing_header_posn [dict get $resultinfo position]
set existing_header_posn [dict get $resultinfo position]
puts stderr "\x1b\[32mNo existing records found in punkcheck file '$o_checkfile' for installer '$installername'. Starting with empty record list.\x1b\[m"
} else {
#verify no duplicate installer records for this installer.
#JMN
set sanity_dict [dict create]
set insane ""
foreach rec $o_record_list {
if {[dict get $rec tag] eq "INSTALLER"} {
set name [dict get $rec -name]
if {[dict exists $sanity_dict $name]} {
#todo - warn - duplicate record for same targetlist - shouldn't happen as we should be using get_file_record to find existing records
puts stderr "\x1b\[31mpunkcheck::recordlist::records_as_target_dict - multiple records with same targetlist '$tgtlist'\x1b\[m"
set insane "$name"
break
}
dict set sanity_dict $name {}
}
}
if {$insane ne ""} {
set msg "Sanity check: punkcheck file '$o_checkfile' contains multiple records for INSTALLER -name '$insane'."
append msg \n "This may indicate a problem such as multiple concurrent installtrack instances using the same punkcheck file,"
append msg \n " or a previous installtrack instance that did not complete properly."
append msg \n " Please verify that this is expected and safe to proceed before confirming with 'yes'."
set answer [punk::lib::askuser $msg]
if {$answer ne "yes"} {
error "Aborting due to sanity check failure. User did not confirm with 'yes'."
}
if {[file exists $o_checkfile] && [file isfile $o_checkfile]} {
file delete $o_checkfile
}
if {[file exists $o_checkfile]} {
error "Failed to delete punkcheck file '$o_checkfile' after sanity check failure. Please investigate and resolve the issue before proceeding."
}
set o_record_list [list]
} else {
puts stderr "\x1b\[32mSanity check passed: no duplicate INSTALLER records found for installer '$installername' in punkcheck file '$o_checkfile'.\x1b\[m"
}
unset sanity_dict
}
set resultinfo [punkcheck::recordlist::get_installer_record $o_name $o_record_list]
set resultinfo [punkcheck::recordlist::get_installer_record $o_name $o_record_list]
set existing_header_posn [dict get $resultinfo position]
set existing_header_posn [dict get $resultinfo position]