From 7bf0fe3c56ed1e8ca9a55ab3dbf6943f94e2a1af Mon Sep 17 00:00:00 2001 From: Werner Llácer Date: Mon, 1 Aug 2022 10:38:22 +0200 Subject: restoring ability to use a predefined installation directory (#1373) --- archinstall/lib/menu/global_menu.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'archinstall/lib/menu') diff --git a/archinstall/lib/menu/global_menu.py b/archinstall/lib/menu/global_menu.py index 1badc052..d9943945 100644 --- a/archinstall/lib/menu/global_menu.py +++ b/archinstall/lib/menu/global_menu.py @@ -42,6 +42,7 @@ if TYPE_CHECKING: class GlobalMenu(GeneralMenu): def __init__(self,data_store): + self._disk_check = True super().__init__(data_store=data_store, auto_cursor=True, preview_size=0.3) def _setup_selection_menu_options(self): @@ -304,11 +305,12 @@ class GlobalMenu(GeneralMenu): missing += ['Hostname'] if not check('!root-password') and not has_superuser(): missing += [str(_('Either root-password or at least 1 user with sudo privileges must be specified'))] - if not check('harddrives'): - missing += [str(_('Drive(s)'))] - if check('harddrives'): - if not self._menu_options['harddrives'].is_empty() and not check('disk_layouts'): - missing += [str(_('Disk layout'))] + if self._disk_check: + if not check('harddrives'): + missing += [str(_('Drive(s)'))] + if check('harddrives'): + if not self._menu_options['harddrives'].is_empty() and not check('disk_layouts'): + missing += [str(_('Disk layout'))] return missing @@ -334,7 +336,7 @@ class GlobalMenu(GeneralMenu): def _select_harddrives(self, old_harddrives : list) -> List: harddrives = select_harddrives(old_harddrives) - if harddrives: + if harddrives is not None: if len(harddrives) == 0: prompt = _( "You decided to skip harddrive selection\nand will use whatever drive-setup is mounted at {} (experimental)\n" @@ -345,7 +347,10 @@ class GlobalMenu(GeneralMenu): choice = Menu(prompt, Menu.yes_no(), default_option=Menu.yes(), skip=False).run() if choice.value == Menu.no(): + self._disk_check = True return self._select_harddrives(old_harddrives) + else: + self._disk_check = False # in case the harddrives got changed we have to reset the disk layout as well if old_harddrives != harddrives: -- cgit v1.2.3-54-g00ecf