diff --git a/archinstall/lib/disk/partitioning_menu.py b/archinstall/lib/disk/partitioning_menu.py index 6e784a3045..03da646c07 100644 --- a/archinstall/lib/disk/partitioning_menu.py +++ b/archinstall/lib/disk/partitioning_menu.py @@ -323,17 +323,17 @@ def handle_action( partition.invert_flag(PartitionFlag.XBOOTLDR) case 'set_filesystem': fs_type = self._prompt_partition_fs_type() - if fs_type: - if partition.is_swap(): - partition.invert_flag(PartitionFlag.SWAP) - partition.fs_type = fs_type - if partition.is_swap(): - partition.mountpoint = None - partition.flags = [] - partition.set_flag(PartitionFlag.SWAP) - # btrfs subvolumes will define mountpoints - if fs_type == FilesystemType.Btrfs: - partition.mountpoint = None + + if partition.is_swap(): + partition.invert_flag(PartitionFlag.SWAP) + partition.fs_type = fs_type + if partition.is_swap(): + partition.mountpoint = None + partition.flags = [] + partition.set_flag(PartitionFlag.SWAP) + # btrfs subvolumes will define mountpoints + if fs_type == FilesystemType.Btrfs: + partition.mountpoint = None case 'btrfs_mark_compressed': self._toggle_mount_option(partition, BtrfsMountOption.compress) case 'btrfs_mark_nodatacow': diff --git a/archinstall/lib/global_menu.py b/archinstall/lib/global_menu.py index 50e4f0de21..3aebeaae9c 100644 --- a/archinstall/lib/global_menu.py +++ b/archinstall/lib/global_menu.py @@ -511,18 +511,17 @@ def _create_user_account(self, preset: list[User] | None = None) -> list[User]: users = ask_for_additional_users(defined_users=preset) return users - def _mirror_configuration(self, preset: MirrorConfiguration | None = None) -> MirrorConfiguration | None: + def _mirror_configuration(self, preset: MirrorConfiguration | None = None) -> MirrorConfiguration: mirror_configuration = MirrorMenu(preset=preset).run() - if mirror_configuration: - if mirror_configuration.optional_repositories: - # reset the package list cache in case the repository selection has changed - list_available_packages.cache_clear() + if mirror_configuration.optional_repositories: + # reset the package list cache in case the repository selection has changed + list_available_packages.cache_clear() - # enable the repositories in the config - pacman_config = PacmanConfig(None) - pacman_config.enable(mirror_configuration.optional_repositories) - pacman_config.apply() + # enable the repositories in the config + pacman_config = PacmanConfig(None) + pacman_config.enable(mirror_configuration.optional_repositories) + pacman_config.apply() return mirror_configuration diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 73c5db3007..e0f6da2d4e 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1012,7 +1012,7 @@ def _get_kernel_params_partition( # TODO: We need to detect if the encrypted device is a whole disk encryption, # or simply a partition encryption. Right now we assume it's a partition (and we always have) - if self._disk_encryption and self._disk_encryption.hsm_device: + if self._disk_encryption.hsm_device: debug(f'Root partition is an encrypted device, identifying by UUID: {root_partition.uuid}') # Note: UUID must be used, not PARTUUID for sd-encrypt to work kernel_parameters.append(f'rd.luks.name={root_partition.uuid}=root') @@ -1672,8 +1672,7 @@ def _create_user(self, user: User) -> None: if result := plugin.on_user_created(self, user): handled_by_plugin = result - if user.password: - self.set_user_password(user) + self.set_user_password(user) for group in user.groups: SysCommand(f'arch-chroot {self.target} gpasswd -a {user.username} {group}') @@ -1684,7 +1683,7 @@ def _create_user(self, user: User) -> None: def set_user_password(self, user: User) -> bool: info(f'Setting password for {user.username}') - enc_password = user.password.enc_password if user.password else None + enc_password = user.password.enc_password if not enc_password: debug('User password is empty') diff --git a/archinstall/lib/pacman/config.py b/archinstall/lib/pacman/config.py index d3f4b9ddf0..6b46824636 100644 --- a/archinstall/lib/pacman/config.py +++ b/archinstall/lib/pacman/config.py @@ -8,6 +8,7 @@ class PacmanConfig: def __init__(self, target: Path | None): self._config_path = Path('/etc') / 'pacman.conf' + self._config_remote_path: Path | None = None if target: self._config_remote_path = target / 'etc' / 'pacman.conf' diff --git a/archinstall/scripts/only_hd.py b/archinstall/scripts/only_hd.py index 48205e264c..f9a7b26bb6 100644 --- a/archinstall/scripts/only_hd.py +++ b/archinstall/scripts/only_hd.py @@ -45,8 +45,7 @@ def perform_installation(mountpoint: Path) -> None: ) as installation: # Mount all the drives to the desired mountpoint # This *can* be done outside of the installation, but the installer can deal with it. - if disk_config: - installation.mount_ordered_layout() + installation.mount_ordered_layout() # to generate a fstab directory holder. Avoids an error on exit and at the same time checks the procedure target = Path(f'{mountpoint}/etc/fstab') diff --git a/archinstall/tui/curses_menu.py b/archinstall/tui/curses_menu.py index 88193fa1a5..4b59ce5e75 100644 --- a/archinstall/tui/curses_menu.py +++ b/archinstall/tui/curses_menu.py @@ -13,7 +13,6 @@ from archinstall.lib.translationhandler import tr -from ..lib.output import debug from .help import Help from .menu_item import MenuItem, MenuItemGroup, MenuItemsState from .result import Result, ResultType @@ -87,10 +86,6 @@ def help_entry(self) -> ViewportEntry: return ViewportEntry(tr('Press Ctrl+h for help'), 0, 0, STYLE.NORMAL) def _show_help(self) -> None: - if not self._help_window: - debug('no help window set') - return - help_text = Help.get_help_text() lines = help_text.split('\n') diff --git a/pyproject.toml b/pyproject.toml index 6a6d023964..4aca31b598 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,7 @@ enable_error_code = [ "possibly-undefined", "redundant-expr", "redundant-self", + "truthy-bool", "truthy-iterable", "unimported-reveal", "unused-awaitable",