fix corruption issue by moving corrupted files after closing them (fixes #86)

This commit is contained in:
ihaveahax
2026-01-08 17:47:18 -06:00
parent 09dbf134f1
commit 17aebb3256

View File

@@ -475,13 +475,13 @@ class CustomInstall:
self.log(f'Writing {content_enc_path}...') self.log(f'Writing {content_enc_path}...')
with cia.open_raw_section(co.cindex) as s, open(content_out_path, 'wb') as o: with cia.open_raw_section(co.cindex) as s, open(content_out_path, 'wb') as o:
result_hash = self.copy_with_progress(s, o, co.size, content_enc_path) result_hash = self.copy_with_progress(s, o, co.size, content_enc_path)
if result_hash != co.hash: if result_hash != co.hash:
self.log(f'WARNING: Hash does not match for {content_enc_path}!') self.log(f'WARNING: Hash does not match for {content_enc_path}!')
install_state['failed'].append(display_title) install_state['failed'].append(display_title)
rename(temp_title_root, temp_title_root + '-corrupted') rename(temp_title_root, temp_title_root + '-corrupted')
do_continue = True do_continue = True
self.event.update_status(path, InstallStatus.Failed) self.event.update_status(path, InstallStatus.Failed)
break break
if do_continue: if do_continue:
continue continue