From aa4c0a590f988d7f9d4dc401ba76183c1fe64f74 Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Wed, 8 Apr 2026 08:30:31 -0400 Subject: [PATCH] Refactor sync_log_to_install_medium() --- archinstall/lib/installer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index e9b1050512..bbb276d034 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -506,11 +506,9 @@ def sync_log_to_install_medium(self) -> bool: # at least the base has been strapped in, otherwise we won't have a filesystem/structure to copy to. if self._helper_flags.get('base-strapped', False) is True: absolute_logfile = logger.path - - if not os.path.isdir(f'{self.target}/{os.path.dirname(absolute_logfile)}'): - os.makedirs(f'{self.target}/{os.path.dirname(absolute_logfile)}') - - shutil.copy2(absolute_logfile, f'{self.target}/{absolute_logfile}') + logfile_target = self.target / absolute_logfile + logfile_target.parent.mkdir(parents=True, exist_ok=True) + absolute_logfile.copy(logfile_target, preserve_metadata=True) return True