Skip to content

Commit 1bf87c6

Browse files
authored
Use Path.copy() (#4398)
1 parent 6505e17 commit 1bf87c6

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

archinstall/lib/installer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import platform
33
import re
44
import shlex
5-
import shutil
65
import subprocess
76
import textwrap
87
import time
@@ -1483,7 +1482,7 @@ def _add_limine_bootloader(
14831482
efi_dir_path.mkdir(parents=True, exist_ok=True)
14841483

14851484
for file in ('BOOTIA32.EFI', 'BOOTX64.EFI'):
1486-
shutil.copy(limine_path / file, efi_dir_path)
1485+
(limine_path / file).copy(efi_dir_path)
14871486
except Exception as err:
14881487
raise DiskError(f'Failed to install Limine in {self.target}{efi_partition.mountpoint}: {err}')
14891488

@@ -1532,7 +1531,7 @@ def _add_limine_bootloader(
15321531

15331532
try:
15341533
# The `limine-bios.sys` file contains stage 3 code.
1535-
shutil.copy(limine_path / 'limine-bios.sys', boot_limine_path)
1534+
(limine_path / 'limine-bios.sys').copy(boot_limine_path)
15361535

15371536
# `limine bios-install` deploys the stage 1 and 2 to the
15381537
self.arch_chroot(f'limine bios-install {parent_dev_path}', peek_output=True)

archinstall/lib/pacman/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import re
22
from pathlib import Path
3-
from shutil import copy2
43

54
from archinstall.lib.models.packages import Repository
65
from archinstall.lib.pathnames import PACMAN_CONF
@@ -52,4 +51,4 @@ def apply(self) -> None:
5251

5352
def persist(self) -> None:
5453
if self._repositories and self._config_remote_path:
55-
copy2(PACMAN_CONF, self._config_remote_path)
54+
PACMAN_CONF.copy(self._config_remote_path, preserve_metadata=True)

0 commit comments

Comments
 (0)