|
16 | 16 | from pathlib import Path |
17 | 17 | from select import EPOLLHUP, EPOLLIN, epoll |
18 | 18 | from shutil import which |
19 | | -from typing import TYPE_CHECKING, Any, override |
| 19 | +from typing import Any, override |
20 | 20 |
|
21 | 21 | from .exceptions import RequirementError, SysCallError |
22 | | -from .output import debug, error, info |
| 22 | +from .output import debug, error |
23 | 23 | from .storage import storage |
24 | 24 |
|
25 | | -if TYPE_CHECKING: |
26 | | - from .installer import Installer |
27 | | - |
28 | 25 | # https://stackoverflow.com/a/43627833/929999 |
29 | 26 | _VT100_ESCAPE_REGEX = r'\x1B\[[?0-9;]*[a-zA-Z]' |
30 | 27 | _VT100_ESCAPE_REGEX_BYTES = _VT100_ESCAPE_REGEX.encode() |
@@ -479,20 +476,6 @@ def _pid_exists(pid: int) -> bool: |
479 | 476 | return False |
480 | 477 |
|
481 | 478 |
|
482 | | -def run_custom_user_commands(commands: list[str], installation: Installer) -> None: |
483 | | - for index, command in enumerate(commands): |
484 | | - script_path = f"/var/tmp/user-command.{index}.sh" |
485 | | - chroot_path = f"{installation.target}/{script_path}" |
486 | | - |
487 | | - info(f'Executing custom command "{command}" ...') |
488 | | - with open(chroot_path, "w") as user_script: |
489 | | - user_script.write(command) |
490 | | - |
491 | | - SysCommand(f"arch-chroot {installation.target} bash {script_path}") |
492 | | - |
493 | | - os.unlink(chroot_path) |
494 | | - |
495 | | - |
496 | 479 | def secret(x: str) -> str: |
497 | 480 | """ return * with len equal to to the input string """ |
498 | 481 | return '*' * len(x) |
0 commit comments